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: RFA: partially hookize *_TYPE_SIZE


Quoting "Joseph S. Myers" <joseph@codesourcery.com>:

On Tue, 30 Nov 2010, Joern Rennecke wrote:

DEFHOOK
(size_type,
"If @var{diff_type} is false, return the @code{integer_type_kind} value for\
@code{size_type}; if @var{diff_type} is true, return the\
@code{integer_type_kind} value for @code{ptrdiff_t}.",
integer_type_kind, (bool diff_type),
default_size_type)

DEFHOOK
(wchar_type,
"If @var{int_type} is false, return the @code{integer_type_kind} value for\
@code{wchar_t}; if @var{int_type} is true, return the
@code{integer_type_kind}\ value for @code{wint_t}.",
integer_type_kind, (bool int_type),
default_wchar_type)

I think it's better just to pass enum tree_index values to these hooks, so it's immediately obvious from a call what it means rather than needing to know which case is "true" and which is "false".

I see your point. The name of the parameter is not evident at the call site. I suppose the best way to handle the enum tree_index dependency (not all users of target.h use tree.h) is to declare these hooks to take an int argument.


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