getline() in C++ - _GNU_SOURCE not needed?
问题 Firstly, I'm pretty new to C++. I believe that getline() isn't a standard C function, so #define _GNU_SOURCE is required to use it. I'm now using C++ and g++ tells me that _GNU_SOURCE is already defined: $ g++ -Wall -Werror parser.cpp parser.cpp:1:1: error: "_GNU_SOURCE" redefined <command-line>: error: this is the location of the previous definition Can anyone confirm if this is standard, or is its definition hidden somewhere in my setup? I'm not sure of the meaning of the final line quoted.