0

For -std=c17 (and higher) DW_AT_language is C11:

$ echo "int x;" | gcc -c -xc - -fPIC -o x.o -g -std=c17
$ gcc -shared -o x.so x.o
$ readelf x.so -w | grep -P '(DW_AT_language\s*:|DWARF Version:)'
    <11>   DW_AT_language    : 29       (C11)
  DWARF Version:               5

$ gcc --version
gcc-14.2.0 (GCC) 14.2.0

$ readelf --version
GNU readelf (GNU Binutils for Ubuntu) 2.38

The C11 is produced when using -std=c18 and -std=c2x.

Why DW_AT_language is C11 for -std=c17 (and higher)?

Is it because Language Codes Added Since Version 5 (e.g. DW_LANG_C17) perhaps have not yet been implemented by GCC and/or by readelf?

Note: this question is asked out of curiosity. There is no real issue associated with this question.

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.