Debug

Programming, for all ages and all languages.
Post Reply
User avatar
crazygray1
Member
Member
Posts: 168
Joined: Thu Nov 22, 2007 7:18 pm
Location: USA,Hawaii,Honolulu(Seriously)

Debug

Post by crazygray1 »

I don't see the prob here:

gcc outputs this:
kristian@Kristian:~/Documents/Decipher/Source/Boot/include$ gcc boot.c
In file included from boot.c:1:
basicio.h:3: warning: large integer implicitly truncated to unsigned type
basicio.h: In function ‘clrscrn’:
basicio.h:9: error: expected ‘;’ before ‘)’ token
basicio.h:9: error: expected expression before ‘)’ token
basicio.h:13: warning: large integer implicitly truncated to unsigned type
basicio.h: In function ‘bprint’:
basicio.h:19: warning: cast to pointer from integer of different size
basicio.h:20: error: expected ‘;’ before ‘)’ token
basicio.h:20: error: expected expression before ‘)’ token
basicio.h:24: warning: comparison is always false due to limited range of data type

as you can see there isn't much in boot.c

Edit: I feel really stupid not seeing the ; needed in the for statments
now there seems to be another thing with them...
Attachments
basicio.h
(1.03 KiB) Downloaded 27 times
boot.c
(351 Bytes) Downloaded 33 times
Last edited by crazygray1 on Thu Jan 10, 2008 8:00 pm, edited 1 time in total.
User avatar
crazygray1
Member
Member
Posts: 168
Joined: Thu Nov 22, 2007 7:18 pm
Location: USA,Hawaii,Honolulu(Seriously)

Post by crazygray1 »

Ok I got it down to this:

kristian@Kristian:~/Documents/Decipher/Source/Boot/include$ gcc -c boot.c
In file included from boot.c:1:
basicio.h:3: warning: large integer implicitly truncated to unsigned type
basicio.h: In function ‘clrscrn’:
basicio.h:9: error: expected expression before ‘)’ token
basicio.h:14: warning: large integer implicitly truncated to unsigned type
basicio.h: In function ‘bprint’:
basicio.h:20: warning: cast to pointer from integer of different size
basicio.h:21: error: expected expression before ‘)’ token
basicio.h:26: warning: comparison is always false due to limited range of data type

I didn't post boot.c because nothing changed there
Attachments
basicio.h
(1.03 KiB) Downloaded 28 times
User avatar
crazygray1
Member
Member
Posts: 168
Joined: Thu Nov 22, 2007 7:18 pm
Location: USA,Hawaii,Honolulu(Seriously)

Post by crazygray1 »

I got the error messages down to this:

kristian@Kristian:~/Documents/Decipher/Source/Boot/include$ gcc boot.c
In file included from boot.c:1:
basicio.h: In function ‘clrscrn’:
basicio.h:9: error: expected expression before ‘)’ token
basicio.h:14: warning: assignment makes pointer from integer without a cast
basicio.h: In function ‘bprint’:
basicio.h:21: error: expected expression before ‘)’ token
basicio.h:26: warning: comparison between pointer and integer
kristian@Kristian:~/Documents/Decipher/Source/Boot/include$

what is expression is missing in my for statements?
Attachments
basicio.h
(1.04 KiB) Downloaded 64 times
Laksen
Member
Member
Posts: 140
Joined: Fri Nov 09, 2007 3:30 am
Location: Aalborg, Denmark

Post by Laksen »

instead of "for(i = 0,i<0xBFFFF,i++;)"
Wouldn't you mean: "for(i = 0;<0xBFFFF;i++)"?
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

I have a hard time believing you're experienced enough with the C programming language.

Learning while you attempt an OS is a bad idea.. IMHO anyway. :roll:

For sake of completeness, take a close look at your for loops... :wink:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
crazygray1
Member
Member
Posts: 168
Joined: Thu Nov 22, 2007 7:18 pm
Location: USA,Hawaii,Honolulu(Seriously)

Post by crazygray1 »

Brynet-Inc wrote:I have a hard time believing you're experienced enough with the C programming language
I just have probs with for loops. I never stuck with one particular compiler, syntaxes are somewhat diffrent for each(at least on little things.

thanks.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

crazygray1 wrote:I just have probs with for loops. I never stuck with one particular compiler, syntaxes are somewhat diffrent for each(at least on little things.
Bull. As said by brynet-inc here, and half the forum in the language-bashing thread, the problem exists between keyboard and chair.

Until you can at least fix these problems without help, I do not think you should be discussing anything C related here.

I suggest visiting http://www.cprogramming.com/ which is more suited for people like you.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
crazygray1
Member
Member
Posts: 168
Joined: Thu Nov 22, 2007 7:18 pm
Location: USA,Hawaii,Honolulu(Seriously)

Post by crazygray1 »

Assembly is so much easier.
User avatar
hailstorm
Member
Member
Posts: 110
Joined: Wed Nov 02, 2005 12:00 am
Location: The Netherlands

Post by hailstorm »

If you don't want to think about syntax, yes. :twisted:
Hope your programming skills are better than your c knowledge... :wink:
Shalted
Posts: 19
Joined: Wed Nov 07, 2007 12:09 am

Post by Shalted »

I don't want to be a jerk, but isn't it considered bad practice to have code within your header files? Actually, won't your linker give you problems ("More than one symbol declared as X", "Symbol already declared", or something along those lines), if you try to link more than one object with it included?
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

Hm....seems like a simple mess-up.
I will give you this: Sometimes..(sometimes)..you miss simple things.
But try to figure it out. :roll:

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Post Reply