Page 1 of 1
Debug
Posted: Thu Jan 10, 2008 7:34 pm
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...
Posted: Thu Jan 10, 2008 7:43 pm
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
Posted: Thu Jan 10, 2008 7:59 pm
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?
Posted: Thu Jan 10, 2008 9:23 pm
by Laksen
instead of "for(i = 0,i<0xBFFFF,i++;)"
Wouldn't you mean: "for(i = 0;<0xBFFFF;i++)"?
Posted: Thu Jan 10, 2008 9:26 pm
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.
For sake of completeness, take a close look at your
for loops...
Posted: Fri Jan 11, 2008 5:38 am
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.
Posted: Fri Jan 11, 2008 5:51 am
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.
Posted: Fri Jan 11, 2008 6:05 am
by crazygray1
Assembly is so much easier.
Posted: Fri Jan 11, 2008 8:28 am
by hailstorm
If you don't want to think about syntax, yes.
Hope your programming skills are better than your c knowledge...
Posted: Sun Jan 13, 2008 9:55 pm
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?
Posted: Sun Jan 13, 2008 10:46 pm
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.
-JL