On 5/26/22 19:17, Tom Tromey wrote: >>>>>> "Tom" == Tom de Vries via Gdb-patches writes: > > Tom> Make sure we error out on overflow instead of truncating in all cases. > Tom> I've used as overflow string: "Integer literal is too large", based > Tom> on what I found at > Tom> /src/test/ui/parser/int-literal-too-large-span.rs > Tom> but perhaps someone has a better idea. > > Tom> - value = strtoulst (number.c_str () + offset, NULL, radix); > Tom> + const char *trailer; > Tom> + value = strtoulst (number.c_str () + offset, &trailer, radix); > Tom> + if (*trailer != '\0') > Tom> + error ("Integer literal is too large"); > > This seems fine, though I think it's normal to use _() around the > argument to error. > Indeed, and I forgot to follow up on that before commit. Fixed in this commit. > Tom> + } elseif { $lang == "rust" } { > Tom> + set re_overflow "Integer literal is too large" > > I don't mind if this is there, but normally the Rust lexer uses unit > tests. They are in rust-parse.c, see rust_lex_tests. Ack, and I did wonder whether it would be a good idea to port the entire test-case to the unit tests, since it might help with the test duration and enable us to test for all archs again. For now though, I'm leaving things as they are. Thanks, - Tom