Andes Workshop

It is currently Fri Mar 29, 2024 5:28 am

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to change C standard/default standard
PostPosted: Fri Jan 05, 2018 4:35 pm 
Offline

Joined: Mon Dec 12, 2016 5:07 pm
Posts: 18
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 16444 times ]
Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group