pastebin - collaborative debugging tool
rovema.kpaste.net RSS


Test for gcc version
Posted by Anonymous on Tue 31st Aug 2021 16:19
raw | new post

  1. **** Documentation:
  2. https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
  3.  
  4.  
  5. **** Symbols to use:
  6. #define GCC_VERSION (__GNUC__ * 10000 \
  7.                      + __GNUC_MINOR__ * 100 \
  8.                      + __GNUC_PATCHLEVEL__)
  9. /* Test for GCC > 3.2.0 */
  10. #if GCC_VERSION > 30200
  11.  
  12.  
  13. **** How can I find out which gcc version I use ?
  14. $ gcc -dM -E - < /dev/null | egrep GNUC
  15. #define __GNUC__ 10
  16. #define __GNUC_PATCHLEVEL__ 0
  17. #define __GNUC_STDC_INLINE__ 1
  18. #define __GNUC_MINOR__ 2

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at