popen returns int (do I need to define __USE_POSIX2 etc?)
- From: mark.bergman@xxxxxxxxxxxxx
- Date: 28 Apr 2006 07:14:34 -0700
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
.
- Follow-Ups:
- Re: popen returns int (do I need to define __USE_POSIX2 etc?)
- From: mark . bergman
- Re: popen returns int (do I need to define __USE_POSIX2 etc?)
- Prev by Date: Hardware Diagnostics
- Next by Date: Re: popen returns int (do I need to define __USE_POSIX2 etc?)
- Previous by thread: Hardware Diagnostics
- Next by thread: Re: popen returns int (do I need to define __USE_POSIX2 etc?)
- Index(es):
Relevant Pages
|