https://github.com/devlights/detect-gcc-default-stdc-version
This is a sample code to check the version of the C language standard specification applied by default in gcc.
https://github.com/devlights/detect-gcc-default-stdc-version
Last synced: about 2 months ago
JSON representation
This is a sample code to check the version of the C language standard specification applied by default in gcc.
- Host: GitHub
- URL: https://github.com/devlights/detect-gcc-default-stdc-version
- Owner: devlights
- License: mit
- Created: 2023-05-01T10:07:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-01T10:20:33.000Z (about 2 years ago)
- Last Synced: 2025-02-12T08:58:27.525Z (3 months ago)
- Language: C
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# detect-gcc-default-stdc-version
This is a sample code to check the version of the C language standard specification applied by default in gcc.
# Requirements
- [GCC](https://gcc.gnu.org/)
- [Task](https://taskfile.dev/#/)# How to run
The following was executed on Gitpod.
```sh
$ task --list
task: Available tasks for this project:
* cmd-only: Command only (no source code)
* normal-way: Normal way (with source code)$ task normal-way
task: [normal-way] gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.task: [normal-way] gcc -o app main.c
task: [normal-way] ./app
C Standard: 201710
task: [normal-way] rm ./app$ task cmd-only
# https://mikoto2000.blogspot.com/2020/08/gcc-std.html
task: [cmd-only] echo | gcc -dM -E - | grep STDC_V
#define __STDC_VERSION__ 201710L
```# REFERENCES
- [gcc の std オプションのデフォルト値を調べる](https://mikoto2000.blogspot.com/2020/08/gcc-std.html)