Andes Workshop
http://forum.andestech.com/

How to change C standard/default standard
http://forum.andestech.com/viewtopic.php?f=6&t=1008
Page 1 of 1

Author:  Hubert Chung [ Fri Jan 05, 2018 4:35 pm ]
Post subject:  How to change C standard/default standard

The default standards of gcc is gnu89 and g++ is gnu++98.
To check the default values in the command line, please use the following corresponding commands.

gcc: nds32le-elf-gcc -E -dM - < /dev/null | grep __STDC_VERSION__
The absent of output represents gnu89. If the output is “#define __STDC_VERSION__ 201112L”, it represents the standard is gnu11.

g++: nds32le-elf-g++ -E -dM -x c++ /dev/null | grep -F __cplusplus
If the output is “#define __cplusplus 199711L”, the standard is gnu++98
If the output is “#define __cplusplus 201103L”, the standard is gnu++11
---------------
C99 should support the types:
uint8_t, uint16_t and uint32_t, the header stdint.h should be included.

Attachments:
Compiler_C99_stdint.png
Compiler_C99_stdint.png [ 122.22 KiB | Viewed 32 times ]

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/