This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, C] options generation and language count
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Gary Funck <gary at intrepid dot com>
- Cc: Gcc Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 2 Sep 2011 13:42:32 +0000 (UTC)
- Subject: Re: [Patch, C] options generation and language count
- References: <20110829234640.GB26527@intrepid.com> <Pine.LNX.4.64.1108301545230.23667@digraph.polyomino.org.uk> <20110830160649.GM31092@intrepid.com> <Pine.LNX.4.64.1108301657220.23667@digraph.polyomino.org.uk> <20110901214924.GA7377@intrepid.com>
On Thu, 1 Sep 2011, Gary Funck wrote:
> +# MAX_LANG is the maximum number of languages that can be defined.
> +# Its value is extracted from the value of CL_PARAMS in opts.h
> +# and is passed on the command line as '-v max_lang=...'.
> +if (n_langs > max_lang) {
> + print "Error: the number of defined languages (" n_langs ") " \
> + "exceeds the maximum supported by this implementation " \
> + "(" max_lang ")" > "/dev/stderr"
> + exit 2
Are you sure this /dev/stderr reference is portable?
I think this is trying to be too clever and you should just generate
#if/#error in the output just like all the other error checks, and so not
need to extract a value from a header with awk at all.
--
Joseph S. Myers
joseph@codesourcery.com