gengtype improvements for plugins. patch 1/N

Laurynas Biveinis laurynas.biveinis@gmail.com
Fri Sep 3 08:02:00 GMT 2010


>	* gengtype.c: Added #include of getopt.h & version.h. Moved the

* gengtype.c: Include getopt.h and version.h. ...

> 	(srcdir, srcdir_len, do_dump): definitions moved to gengtype.c,

Capitalize definitions.

> 	(gengtype_long_options): Added new static variable.

> 	(print_usage): Added new function.
>	(print_version): Added new function.
>  	(parse_program_options): Added new function.

(gengtype_long_options): New.
(print_usage, print_version, parse_program_options): New.

>	(main): use parse_program_options, cleaned up a bit. Added stubs
> 	for read & write of state.

(main): Call parse_program_options, remove old option handling code.

> 	* gengtype.h: Moved many things from gengtype.c to here.
> 	(outf, outf_p, output_files, header_file, srcdir, srcdir_len)
> 	(do_dump): Moved variables from gengtype.c

* gengtype.h (outf, ...): Move from gengtype.c to here.

> @@ -142,26 +132,37 @@ const char *get_output_file_name (const char *);
>  static void oprintf (outf_p o, const char *S, ...)
>       ATTRIBUTE_PRINTF_2;
>
> -/* The list of output files.  */
> -static outf_p output_files;
>
> +/* Rhe name of the file containing the list of input files. */

The

> -/* The output header file that is included into pretty much every
> -   source file.  */

Why did you drop this comment?

> -static outf_p header_file;
> +/* Our output files and output header file.  */
> +outf_p output_files;
> +outf_p header_file;

> +static void
> +print_usage (void)
> +{
> +    printf ("Usage: %s\n", progname);
> +    printf ("\t -h | --help  \t# Give this help.\n");
> +    printf ("\t -D | --debug  \t# Lots of debug output to debug gengtype itself.\n");

Please adjust this message so that it starts with a verb, like all the others.

> +	nb_plugin_files = argc - optind;
> +	for  (i = 0; i < (int) nb_plugin_files; i++)
> +	{
> +	    char *name = argv[i + optind];
> +	    plugin_files[i] = name;
> +	}

This implies that there can be more than one plugin output file
specified, yet the description of invocation options above discusses
only single file.

> +/* Sets of accepted source languages like C, C++, Ada ... are
> +   represented by a bitmap.  */

I'm no native speaker myself, but I'd write "The bitmap for
representing a subset of known languages (C, C++, Ada, etc.)".


I cannot approve, but the gengtype parts look OK to me with these
comments addressed.

Thanks for working on this,
Laurynas

2010/8/29 Basile Starynkevitch <basile@starynkevitch.net>:
>
> There was a one letter typo in the patch (for the gengtype_long_options
> array, line "version", short letter).
>
> So here is the latest and hopefully final version of the patch.
>
> the patch relative to trunk is file patch01ter-r163612-progarg.diff
>
> the gcc/ChangeLog entry is  patch01ter-r163612-progarg.ChangeLog
>
> Ok for trunk?
>
> --
> Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
> email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
> 8, rue de la Faiencerie, 92340 Bourg La Reine, France
> *** opinions {are only mine, sont seulement les miennes} ***
>



-- 
Laurynas



More information about the Gcc-patches mailing list