public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/111287] New: doc: "strict ISO mode" definition is not up-to-date
@ 2023-09-04 19:38 bruno at clisp dot org
  2023-09-04 20:29 ` [Bug other/111287] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bruno at clisp dot org @ 2023-09-04 19:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111287

            Bug ID: 111287
           Summary: doc: "strict ISO mode" definition is not up-to-date
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bruno at clisp dot org
  Target Milestone: ---

In https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
we read: "Outside strict ISO C mode (-ansi, -std=c90, -std=c99 or -std=c11)
..."

Nowadays, the options -std=c17 and -std=c2x also put gcc in "strict ISO C
mode", as can be seen from the __STRICT_ANSI__ preprocessor macro:

$ : | gcc -std=c90 -E -dM - | grep __STRICT_ANSI__
#define __STRICT_ANSI__ 1
$ : | gcc -std=c99 -E -dM - | grep __STRICT_ANSI__
#define __STRICT_ANSI__ 1
$ : | gcc -std=c11 -E -dM - | grep __STRICT_ANSI__
#define __STRICT_ANSI__ 1
$ : | gcc -std=c17 -E -dM - | grep __STRICT_ANSI__
#define __STRICT_ANSI__ 1
$ : | gcc -std=c2x -E -dM - | grep __STRICT_ANSI__
#define __STRICT_ANSI__ 1

Could this sentence in the manual be updated to include these new -std options?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug other/111287] doc: "strict ISO mode" definition is not up-to-date
  2023-09-04 19:38 [Bug other/111287] New: doc: "strict ISO mode" definition is not up-to-date bruno at clisp dot org
@ 2023-09-04 20:29 ` redi at gcc dot gnu.org
  2024-01-18 21:11 ` sandra at gcc dot gnu.org
  2024-01-18 21:22 ` jsm28 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2023-09-04 20:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111287

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-09-04
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Or just add ", etc." so it doesn't need to be updated again.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug other/111287] doc: "strict ISO mode" definition is not up-to-date
  2023-09-04 19:38 [Bug other/111287] New: doc: "strict ISO mode" definition is not up-to-date bruno at clisp dot org
  2023-09-04 20:29 ` [Bug other/111287] " redi at gcc dot gnu.org
@ 2024-01-18 21:11 ` sandra at gcc dot gnu.org
  2024-01-18 21:22 ` jsm28 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: sandra at gcc dot gnu.org @ 2024-01-18 21:11 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111287

sandra at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sandra at gcc dot gnu.org

--- Comment #2 from sandra at gcc dot gnu.org ---
I think the problem here goes beyond this one line of documentation.  E.g,
there's a reference to "strict ISO C90 mode" later in the same paragraph that
probably ought to refer to any later C standard as well, and it's not clear
whether "Outside strict ISO C mode" means that these builtins are always
available in C++.  (IOW, does strict ISO C mode disable things that are
otherwise normally supported by C-family dialects, or do non-strict ISO C mode
enable things that are normally are *not* supported?)

Re __STRICT_ANSI__, invoke.texi only says that is defined when -ansi is used,
so either defining it for all those later standards is wrong or the
documentation is wrong (and it needs to be moved out of the description of the
-ansi option).

I think we at least need a formal definition in the manual of what "strict ISO
mode" means, for both C and C++, and to implement/document additional #defines
for different dialects.  It's probably too late to fix __STRICT_ANSI__, though.

In any case, I think the standards compliance section, the -std= options
documentation, and the builtins section all need to be made consistent.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug other/111287] doc: "strict ISO mode" definition is not up-to-date
  2023-09-04 19:38 [Bug other/111287] New: doc: "strict ISO mode" definition is not up-to-date bruno at clisp dot org
  2023-09-04 20:29 ` [Bug other/111287] " redi at gcc dot gnu.org
  2024-01-18 21:11 ` sandra at gcc dot gnu.org
@ 2024-01-18 21:22 ` jsm28 at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2024-01-18 21:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111287

--- Comment #3 from Joseph S. Myers <jsm28 at gcc dot gnu.org> ---
"even in strict ISO C90 mode" is used, correctly, when referring to C90 mode as
the one with the fewest built-in functions; it's talking about __builtin_*,
which are valid in all standards modes.

"except in strict ISO C90 mode" is used, correctly, when talking about built-in
versions of C99 functions (accepted in all modes other than strict C90).

__STRICT_ANSI__ is properly defined for strict ISO C modes (any version).

The "Outside strict ISO C mode" paragraph mostly lists functions not in any
version of the C standard, but a few of them (exp10, roundeven, strdup, etc.)
are in C23 and thus defined using DEF_C23_BUILTIN, and arguably should be moved
to a separate paragraph to reflect that they are defined in strict ISO C23
mode.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-18 21:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04 19:38 [Bug other/111287] New: doc: "strict ISO mode" definition is not up-to-date bruno at clisp dot org
2023-09-04 20:29 ` [Bug other/111287] " redi at gcc dot gnu.org
2024-01-18 21:11 ` sandra at gcc dot gnu.org
2024-01-18 21:22 ` jsm28 at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).