if (c_language == clk_c)
{
+ /* The default for C is gnu99, without warnings for non-static
+ inline functions. */
+ set_std_c99 (false /* ISO */);
+ flag_gnu89_inline = 1;
+
/* If preprocessing assembly language, accept any of the C-family
front end options since the driver may pass them through. */
for (i = 1; i < argc; i++)
publication, this was known as C9X@.
@item gnu89
-The 1990 C standard plus GNU extensions. This is the default.
+The 1990 C standard plus GNU extensions.
@item gnu99
@itemx gnu9x
-The 1999 C standard plus GNU extensions.
+The 1999 C standard plus GNU extensions. This is the default.
@item c++98
The 1998 ISO C++ standard plus amendments.
names \fBc9x\fR and \fBiso9899:199x\fR are deprecated.
.IP "\fBgnu89\fR" 4
.IX Item "gnu89"
-Default, \s-1ISO\s0 C90 plus \s-1GNU\s0 extensions (including some C99 features).
+\&\s-1ISO\s0 C90 plus \s-1GNU\s0 extensions (including some C99 features).
.IP "\fBgnu99\fR" 4
.IX Item "gnu99"
.PD 0
.IP "\fBgnu9x\fR" 4
.IX Item "gnu9x"
.PD
-\&\s-1ISO\s0 C99 plus \s-1GNU\s0 extensions. When \s-1ISO\s0 C99 is fully implemented in \s-1GCC\s0,
-this will become the default. The name \fBgnu9x\fR is deprecated.
+Default, \s-1ISO\s0 C99 plus \s-1GNU\s0 extensions.
+The name \fBgnu9x\fR is deprecated.
.IP "\fBc++98\fR" 4
.IX Item "c++98"
The 1998 \s-1ISO\s0 \*(C+ standard plus amendments.
.ie n .IP """gnu89""" 4
.el .IP "\f(CWgnu89\fR" 4
.IX Item "gnu89"
-The 1990 C standard plus \s-1GNU\s0 extensions. This is the default.
+The 1990 C standard plus \s-1GNU\s0 extensions.
.ie n .IP """gnu99""" 4
.el .IP "\f(CWgnu99\fR" 4
.IX Item "gnu99"
.el .IP "\f(CWgnu9x\fR" 4
.IX Item "gnu9x"
.PD
-The 1999 C standard plus \s-1GNU\s0 extensions.
+The 1999 C standard plus \s-1GNU\s0 extensions. This is the default.
.ie n .IP """c++98""" 4
.el .IP "\f(CWc++98\fR" 4
.IX Item "c++98"
deprecated.
`gnu89'
- Default, ISO C90 plus GNU extensions (including some C99
+ ISO C90 plus GNU extensions (including some C99
features).
`gnu99'
`gnu9x'
- ISO C99 plus GNU extensions. When ISO C99 is fully
- implemented in GCC, this will become the default. The name
- `gnu9x' is deprecated.
+ Default, ISO C99 plus GNU extensions.
+ The name `gnu9x' is deprecated.
`c++98'
The 1998 ISO C++ standard plus amendments.
Before publication, this was known as C9X.
`gnu89'
- The 1990 C standard plus GNU extensions. This is the default.
+ The 1990 C standard plus GNU extensions.
`gnu99'
`gnu9x'
- The 1999 C standard plus GNU extensions.
+ The 1999 C standard plus GNU extensions. This is the default.
`c++98'
The 1998 ISO C++ standard plus amendments.
names @samp{c9x} and @samp{iso9899:199x} are deprecated.
@item gnu89
-Default, ISO C90 plus GNU extensions (including some C99 features).
+ISO C90 plus GNU extensions (including some C99 features).
@item gnu99
@itemx gnu9x
-ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC,
-this will become the default. The name @samp{gnu9x} is deprecated.
+Defaults, ISO C99 plus GNU extensions.
+The name @samp{gnu9x} is deprecated.
@item c++98
The 1998 ISO C++ standard plus amendments.
#endif
c_language = lang;
- parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89 : CLK_GNUCXX);
+ parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC99 : CLK_GNUCXX);
cpp_opts = cpp_get_options (parse_in);
if (flag_objc)
cpp_opts->objc = 1;
flag_const_strings = (lang == clk_cplusplus);
warn_pointer_arith = (lang == clk_cplusplus);
if (lang == clk_c)
- warn_sign_compare = -1;
+ {
+ /* The default for C is gnu99. */
+ set_std_c99 (false /* ISO */);
+
+ warn_sign_compare = -1;
+ }
}
static char *bad_option;
publication, this was known as C9X@.
@item gnu89
-The 1990 C standard plus GNU extensions. This is the default.
+The 1990 C standard plus GNU extensions.
@item gnu99
@itemx gnu9x
-The 1999 C standard plus GNU extensions.
+The 1999 C standard plus GNU extensions. This is the default.
@item c++98
The 1998 ISO C++ standard plus amendments.
names @samp{c9x} and @samp{iso9899:199x} are deprecated.
@item gnu89
-Default, ISO C90 plus GNU extensions (including some C99 features).
+ISO C90 plus GNU extensions (including some C99 features).
@item gnu99
@itemx gnu9x
-ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC,
-this will become the default. The name @samp{gnu9x} is deprecated.
+Default, ISO C99 plus GNU extensions.
+The name @samp{gnu9x} is deprecated.
@item c++98
The 1998 ISO C++ standard plus amendments.
-.\" $OpenBSD: gcc-local.1,v 1.56 2023/10/28 00:25:19 millert Exp $
+.\" $OpenBSD: gcc-local.1,v 1.57 2023/10/29 23:31:16 millert Exp $
.\"
.\" Copyright (c) 2002 Marc Espie
.\" Copyright (c) 2003 Anil Madhavapeddy
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: October 28 2023 $
+.Dd $Mdocdate: October 29 2023 $
.Dt GCC-LOCAL 1
.Os
.Sh NAME
.Ox :
.Bl -dash
.It
+For the C programming language,
+.Nm gcc
+defaults to the
+.Em gnu99
+standard,
+not
+.Em gnu89 .
+The
+.Fl std
+option can be used to select a different language standard.
+.It
.Nm gcc
does not search under
.Pa /usr/local