Skip to content

Commit

Permalink
docs/developers.txt: update about C89/GNU89 support (with GCC toolkit)
Browse files Browse the repository at this point in the history
  • Loading branch information
jimklimov committed Dec 30, 2021
1 parent e5a58ba commit 4af37f4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
19 changes: 13 additions & 6 deletions docs/developers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ miserably for anyone on an older system. That means you must not use
it. gcc only warns about this with -pedantic.

Another feature that does not work on some compilers (e.g. conforming
to ANSI C / C89 standard) is initial variable declaration inside a
to "ANSI C"/C89/C90 standard) is initial variable declaration inside a
'for loop' block, like this:
--------------------------------------------------------------------------------
function do_stuff(void)
Expand All @@ -152,17 +152,24 @@ C99 (or rather GNU99 on many systems) or newer standard.

The NUT codebase may build in a mode without warnings made fatal on C89
(GNU89), but the emitted warnings indicate that those binaries may crash.
By the end of 2021, NUT codebase has been revised to pass GNU and strict-C
mode builds with C89 standard with the GCC toolkit (and on systems that do
have the newer features in libraries, just hide them in standard headers);
however CLANG toolkit is more restrictive about the C99+ syntax used.
If somebody in the community requires to build and run NUT on systems
that old, pull requests to fix the offending coding issues are welcome.

Note also that the NUT codebase currently relies on certain features,
such as the printf format modifiers for `(s)size_t`, that a pedantic C90
mode compilation warns is not part of the standard but a GNU extension
(and part of C99 and newer standard revisions).
such as the printf format modifiers for `(s)size_t`, use of `long long`,
some nuances about structure/array initializers, variadic macros for
debugging, etc. that a pedantic C90 mode compilation warns is not part
of the standard but a GNU extension (and part of C99 and newer standard
revisions). Many of the "offences" against the older standard actually
come from system and third-party header files.

That said, the NUT CI farm does run non-regression builds with GNU C89
standard revision and minimal warnings level, to ensure that codebase
remains at least basically compliant.
and strict C89 standard revisions and minimal passing warnings level,
to ensure that codebase is and remains at least basically compliant.

Continuous Integration and Automated Builds
-------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion docs/nut.dict
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
personal_ws-1.1 en 2801 utf-8
personal_ws-1.1 en 2804 utf-8
AAS
ACFAIL
ACFREQ
Expand Down Expand Up @@ -1854,6 +1854,8 @@ inh
init
init's
initctl
initializer
initializers
initinfo
initscripts
initups
Expand Down Expand Up @@ -2725,6 +2727,7 @@ var's
varargs
varhigh
variable's
variadic
varlow
varname
varvalue
Expand Down

0 comments on commit 4af37f4

Please sign in to comment.