-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make compiles with --std=c99 work #102
Comments
Imported from trac issue 79. Created by glimes on 2015-07-16T11:07:59, last modified: 2019-08-14T14:11:46 |
This has apparently been fixed, at least with BUILDTYPE=release (does -O3) and the following strict flags: See related issues nasa/cFS#39, nasa/cFE#24 |
Note that I would hold off on adding at least |
OSAL has historically attempted to be strict ANSI C90, with
obvious exceptions for cases where the code needed to use a
facility that did not yet exist.
Compile with --std=c90 if you want to see these.
The default compilation we do now does not specify that the
code should be strictly conformant to any standard, so what
we get in practice is GCC's C90 with extensions.
Turning up all the warnings using
{{{
gcc -W -Wall -Wextra -pedantic
}}}
will include a large number of very useful static code
analysis checks, but will warn about the use of C99
facilities that we want to use.
What I propose to do is to run a set of trial builds
where the build script adjusts the compiler flags,
on the fly (no commits), to be:
{{{
gcc --std=c99 -O3 -g -W -Wall -Wextra -pedantic
}}}
This asks GCC to do as thorough a job as it can do to report
any of our code that deviates from
INCITS ISO/IEC 9899:1999
.Our code does require use of facilities not specified in C99,
and these facilities should be enabled, where necessary, by
the use of the appropriate Option Feature Macros. I anticipate that
this will only require certain specific source files to have
an annotation (before the
#include
lines) that they are tobe considered to contain
XOPEN
orPOSIX
standard sourcesat a specific level of those standards.
See also CFE ticket [cfs_cfe:82]
The text was updated successfully, but these errors were encountered: