GNU regcomp(3), regexec(3): '\w'

John Wildberger wildberger-iRg7kjdsKiH3fQ9qLvQP4Q at public.gmane.org
Sat Jan 3 22:02:01 UTC 2004


On January 2, 2004 07:42 pm, Peter L. Peres wrote:

> Eh ? Strange. I just recompiled with all warnings on:
>
> plp-NSb0HxlTAbs at public.gmane.org:~/PROJECTS/REGEXP > gcc -o r r.c -Wall --pedantic
> r.c:9: warning: return-type defaults to `int'
> r.c: In function `main':
> r.c:28: warning: implicit declaration of function `strndup'
> r.c:28: warning: format argument is not a pointer (arg 3)
> r.c:30: warning: control reaches end of non-void function

> plp-NSb0HxlTAbs at public.gmane.org:~/PROJECTS/REGEXP > gcc --version
> 2.7.2.3

My compiler is gcc version 3.2.2
I got similar warnings as above.
The last one is easy to correct by just adding a return 0; at the end.
The implicit declaration warning is usually an indication that the header is 
either missing or internally it is bypassed (defined __USE_GNU  ??)
For what it is worth here are some comments:
The printf() expects a number of 7 for b-a in order to give a result of 
{abc_123}
To see what you have, introduce a printf("a= %d b=%d \n", a,b);
ahead of your printf(..) . You will see that a=0, and b=4. This will give you 
the result {abc_} without  the missing 123.
Maybe this will help.
John
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list