This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, C] options generation and language count


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]