what is this warning in C?
hey - these are some warnings i get and i would like to not see them when i code. it doesnt affect the running of the code, but stilll ...
Code:
implicit declaration of function 'strrchr' Code:
char *end, *line; |
...and, of course, you've added
Code:
#include <string.h> Regards |
of course. :)
|
well your pointers aren't initialized. to you, they look like they're pointing to nowhere, but in reality, where they point to is undefined. they could be pointing to anywhere. always initialize your pointer variables to some value before using them in checks, pointer arithmetic, etc.
not sure about the warning though, if you say <string.h> is included. |
u must be compiling with -ansi huh?
put a prototype in for strchrr and that might clear it up. same happens with strdup |
Code:
#include<string.h> [SaTaN@mirage linux_org]$ ./a.out :test This works fine on my machine.Maybe you should post the entire code. |
thanks guys - all of y'all.
as i mentioned, it doesnt affect the running of the code. the message only comes up when i compile with -Wall. it doesnt come up with a "gcc -o test test.c". thanks again. :) |
put in the prototype anyway!!! :) (all it will do is pass Wall and it will also help it lint with no errors).
|
All times are GMT -5. The time now is 06:00 AM. |