2008-03-26 05:37:39     Best way to enable code in USE_GNU/USE_XOPEN2K define blocks

Document created by Aaronwu Employee on Aug 5, 2013
Version 1Show Document
  • View in full screen mode

2008-03-26 05:37:39     Best way to enable code in USE_GNU/USE_XOPEN2K define blocks

roger froysaa (NORWAY)

Message: 53043    Hi.

 

This may be a retarded question, but I didn't find a quick way to solve it...

 

I built the svn toolchain using the build script.

 

I use the bfin-linux-uclibc-gcc compiler to build a uClinux app. In the app I'm using getline <stdio.h>and pselect <sys/select.h> functions which give implecit declaration warnings during compile. In the source the getline function is wrapped by #ifdef __USE_GNU, while pselect function is wrapped by #ifdef __USE_XOPEN2K.

 

My question is what is the easiest way to enable these functions properly? Do the USE_GNU/USE_XOPEN2K have any "consequences" I should be aware of?

 

BR,

 

Roger

QuoteReplyEditDelete

 

 

2008-03-26 10:05:40     Re: Best way to enable code in USE_GNU/USE_XOPEN2K define blocks

Yi Li (CHINA)

Message: 53055    I don't think you need to define those macros. please refer to comments in "features.h" in your toolchain.

 

you can just post your error message here and the version of your toolchain.

QuoteReplyEditDelete

 

 

2008-03-26 11:00:34     Re: Best way to enable code in USE_GNU/USE_XOPEN2K define blocks

Mike Frysinger (UNITED STATES)

Message: 53061    the feature test macros are controlled by doing things like:

#define _GNU_SOURCE

 

that is most likely what you want to do ... there are other feature test macros and you can get pretty in depth with other ones, but i'd just use this one as it tends to imply most of the others

QuoteReplyEditDelete

 

 

2008-03-26 12:58:40     Re: Best way to enable code in USE_GNU/USE_XOPEN2K define blocks

roger froysaa (NORWAY)

Message: 53066    I had a look at the features.h file, and there's a lot of fun stuff in it, hehe. I will try out what you describe.

 

Thanks

 

--Roger

Attachments

    Outcomes