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: [CPP] 28079 #line range not verified without -pedantic


Manuel López-Ibáñez wrote:

  PR28079
libcpp/
  * directives.c (strtoul_for_line): Add a parameter 'wrapped'.
  (do_line): Update call to strtoul_for_line. Warn if wrapped or if truncated.
  (do_linemarker): Update call to strtoul_for_line.
testsuite/
  * gcc.dg/cpp/line6.c: New.


The patch is OK, with minor change below, unless a preprocessor maintainer objects within 24 hours.


+strtoul_for_line (const uchar *str, unsigned int len, long unsigned int *nump, bool
...
-	return 1;
+	return 2;

You didn't document this new possible return value. I don't see any reason to return 2; do you need this change? If not, please just take it out.


It's a shame we don't make better use of typedefs throughout GCC. A lot of these problems would be less likely to occur if we had something like

typedef unsigned long linenum_type;

and then just used that everywhere...

Thanks,

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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