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: [PING] PR33919/preprocessor fix __BASE_FILE__ when included from the command line


>>>>> "Gary" == Gary Funck <gary@intrepid.com> writes:

Gary> I have a specific question re: this new code.
Gary> +           name = _cpp_get_file_name (pfile->main_file);
Gary> +           if (!name)
Gary> +             name = "<unknown>";
Gary> I wasn't sure whether 'name' can have a NULL value, and handled
Gary> that case as shown above.  Would a gcc_assert() be more
Gary> appropriate, or is it safe to simply assume that the name
Gary> value is not NULL?

I think you can assume that it is not NULL.
libcpp can't use gcc_assert, but if you really want you could do

if (!name)
  abort ();

The patch is ok with either that change or with those 2 lines removed.

Thanks for doing this.

Tom


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