Today I had to use the
man 3 basename
There are two different versions of basename() - the POSIX version described above, and the GNU version, which one gets after
_GNU_SOURCE has nothing to do with license and everything to do with writing (non-)portable code. If you define
_GNU_SOURCE, you will get:
As long as you're aware of these things, it should not be a problem to define
_GNU_SOURCE, but you should avoid defining it and instead define
_XOPEN_SOURCE=700 when possible to ensure that your programs are portable.
In particular, the things from
_GNU_SOURCE that you should never use are #2 and #4 above.