From a343f956096d23d0384510a6616ff0a36c22a691 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 20 Dec 2009 11:17:09 +0100 Subject: Change the default language to ANSI-C. --- ChangeLog | 9 +++++++++ NEWS | 5 +++++ doc/gperf.texi | 4 ++-- src/options.cc | 9 +++++---- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b4fe8b..1c9bbee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2009-12-20 Bruno Haible + Change the default language to ANSI-C. + * src/options.cc (Options::long_usage): Mention new default language. + (Options::Options): Change default of _option_word. + (Options::set_language): Change fallback. + * doc/gperf.texi (Gperf Declarations, Output Language): Mention new + default language. + * NEWS: Mention the change. + Reported by Albert Cahalan . + * src/version.cc (version_string): Bump to 3.1. * doc/gperf.texi: Bump version. diff --git a/NEWS b/NEWS index 85f8088..a15b9b1 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +New in 3.1: +* The generated C code is now in ANSI-C by default. If you want to support + pre-ANSI-C compilers, you need to provide the option --language=C on the + command line or %language=C in the source file. + New in 3.0.4: * gperf is now licensed under the GPL version 3 or newer. diff --git a/doc/gperf.texi b/doc/gperf.texi index b43ee70..0dc1fbe 100644 --- a/doc/gperf.texi +++ b/doc/gperf.texi @@ -502,7 +502,7 @@ ISO C99 compilers, and C++ compilers. C++. This language is understood by C++ compilers. @end table -The default is C. +The default is ANSI-C. @item %define slot-name @var{name} @cindex @samp{%define slot-name} @@ -985,7 +985,7 @@ ANSI C. This language is understood by ANSI C compilers and C++ compilers. C++. This language is understood by C++ compilers. @end table -The default is C. +The default is ANSI-C. @item -a This option is supported for compatibility with previous releases of diff --git a/src/options.cc b/src/options.cc index a60446d..c69d922 100644 --- a/src/options.cc +++ b/src/options.cc @@ -120,7 +120,7 @@ Options::long_usage (FILE * stream) " -L, --language=LANGUAGE-NAME\n" " Generates code in the specified language. Languages\n" " handled are currently C++, ANSI-C, C, and KR-C. The\n" - " default is C.\n"); + " default is ANSI-C.\n"); fprintf (stream, "\n"); fprintf (stream, "Details in the output code:\n"); @@ -448,7 +448,7 @@ PositionStringParser::nextPosition () /* Sets the default Options. */ Options::Options () - : _option_word (C), + : _option_word (ANSIC), _input_file_name (NULL), _output_file_name (NULL), _language (NULL), @@ -574,9 +574,10 @@ Options::set_language (const char *language) _option_word |= CPLUSPLUS; else { - fprintf (stderr, "unsupported language option %s, defaulting to C\n", + fprintf (stderr, + "unsupported language option %s, defaulting to ANSI-C\n", language); - _option_word |= C; + _option_word |= ANSIC; } } } -- cgit v1.2.1