Very elementary question concerning indirection

david nugent david at csource.oz.au
Fri Feb 16 15:49:17 AEST 1990


 > printf( "%c\n",*(strchr(string,40)) );   <---- line in question
 >
 > If the "line in question" is commented out, the program compiles with
 > one warning on line 7 (This is in Vax Ultrex C, no warning is given in
 > Turbo C). What is wrong with the "line in question". Also, what does this
 > warning mean?


It means I _like_ that compiler! :-)

Hmm, one clever enough to understand printf() style format strings is rather 
nice.  It must know it's looking for a char there..

I'm not too surprised TC passes it with no comment.  printf() is defined to 
have a variable number of arguments, and no type checking at all is in 
effect.


david

--  
uucp: ...!munnari!csource!david   
internet: david at csource.oz.au
Via FidoNet 3:632/348, Melbourne, Australia.



More information about the Comp.lang.c mailing list