On Thu, Jun 14, 2012 at 10:33:11PM +0200, Paweł Sikora wrote: > from the others side, someone can use -frecord-gcc-switches to detect mixed > '-std=...' > after final linking and report error in such cases.
I don't think -frecord-gcc-switches is useful for that, unless you always specify explicit -std= option, because with -frecord-gcc-switches without the default -std=gnu98 you get nothing in the note section, and as strings are merged with this option, all you can find out is whether there was at least one -std=c++11 or -std=gnu++0x etc. compiled object. If you use -grecord-gcc-switches, you can investigate the command line per translation unit (and find out which was it), of course for this kind of detection you need to limit yourself to DW_AT_language 4 and then look at DW_AT_producer... Jakub