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




mark.bergman@xxxxxxxxxxxxx wrote:
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 have found that (as well as -ansi) I need to use -D_POSIX_C_SOURCE=2
(is this the best option?)
However, I have another warning being generated from strdup() prototype
not being included - what am I supposed to define to avoid that?

Mark

.



Relevant Pages

  • Re: Urgent C Questions
    ... int, not void. ... Then you need to turn up the warning level on QuickC. ... 3  missing prototype for 'main' ... stdio.h contains the declaration for printf: ...
    (comp.lang.c)
  • Re: Wheres the mistake???
    ... Implicit int ... always a good idea to specify the return type of all functions anyhow. ... As I hope you are aware, a prototype is a function ... Dig the even newer still, yet more improved, sig! ...
    (comp.lang.c)
  • Re: Side project
    ... void display_attribute(char * attribute, char * value, int line) { ... Whenever possible, use enums. ... MOB *createMob; ... the prototype because of the memory cost associated with it. ...
    (rec.games.roguelike.development)
  • Re: Should function argument be changed in function body?
    ... > connected modules to be a connection. ... > we can consider the prototype to be the longest lived of all. ... having function parameters be const ... int foo(int); ...
    (comp.lang.c)
  • Re: General question
    ... declaration for, it assumed that it was a function returning an int ... The first true C standard, ANSI/ISO of 1989 and 1990, changed things. ... Its prototype is: ...
    (comp.lang.c)