This is the mail archive of the 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] Protect generated .h files from multiple inclusion,include tm.h in hooks.h, and FIX BOOTSTRAP

Nathanael Nerode <> writes:

> This is a revised version of 
> This version protects *all* generated headers from multiple inclusion.

I think this part of the patch is a good idea independent of what you
needed it for.

> (Could get into problems if the use of 'sed' turns out to be unportable
> in some stupid way, but I doubt that.)

I think y/// is portable, but just to be safe, suggest you use tr instead:

header_guard=GCC_`echo "$output" | tr "$tr_from" "$tr_to"`

Note also the inclusion of / in the transliteration set.

> +/* We need the definition of enum reg_class (which is in tm.h)
> +   for hook_reg_class_void_no_regs. */
> +#include "tm.h"
> +
>  bool hook_bool_void_false PARAMS ((void));
>  enum reg_class hook_reg_class_void_no_regs (void);
>  bool hook_bool_bool_false (bool);

Bleah.  I do *not* like the appearance of tm.h in this header.  It is
used in langhooks-def.h, which is clearly front-end and has no
business knowing about register classes.  I realize this isn't your
fault but I would ask that you instead find a more appropriate place
to declare hook_reg_class_void_no_regs.


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