popen returns int (do I need to define __USE_POSIX2 etc?)



I am using RHEL 4 (amd64), and I made a short program calling popen(),
including <stdio.h>
It seems that popen() returns an int, not FILE* as per the manual page!

I compile with gcc, and if I assign return value of popen() to FILE*, I
get a warning about int converted to FILE* without a cast.

I notice from /usr/include/stdio.h that popen is only defined if one of
various #'defines are present: __USE_POSIX2, __USE_SVID, __USE_BSD,
__USE_MISC - should I be defining one of these?

TIA
Mark

.



Relevant Pages