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] bug fix for gengtype in plugin mode


Dave Korn wrote:
Diego Novillo wrote:

+      for (i = 0; i < nb_plugin_files; i++)
+      {
+        /* Place an all zero lang_bitmap before the plugin file
+	   name.  */
+        char *name = argv[i + 4];
+        int len = strlen(name) + 1 + sizeof (lang_bitmap);
+        plugin_files[i] = ((char *)xcalloc (len, sizeof(char))) + sizeof (lang_bitmap);
space after '(char *)'. Line is too long.

sizeof(char) is never anything other than 1, btw., you could save a few chars there. I'd write

+ plugin_files[i] = (char *) (1 + (lang_bitmap) xcalloc (len, 1));

I am not sure lang_bitmap is a pointer, and I do find this instruction less easy to understand. I prefer the


        plugin_files[i] = ((char *)xcalloc (len, 1))
                          + sizeof (lang_bitmap);

Otherwise thanks to Rafael for the work.

Regards.

--
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 mines, sont seulement les miennes} ***


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