]> git.ipfire.org Git - thirdparty/gcc.git/commit
expand: C++ify proc macro decls generation
authorArthur Cohen <arthur.cohen@embecosm.com>
Fri, 12 Jan 2024 12:48:43 +0000 (13:48 +0100)
committerCohenArthur <arthur.cohen@embecosm.com>
Mon, 15 Jan 2024 10:09:01 +0000 (10:09 +0000)
commit3fcd86e404cac6763e40ca032aff942a3da09666
treeb0656cea4911e30407e5fa43adcfa1a6c073be52
parentb864866f5271c17918b4fa314971e25c240eed55
expand: C++ify proc macro decls generation

This uses a stringstream instead of the older, better and more readable
`sprintf` version as the format overflow warning in current GCC is
overzealous and triggered on that code, despite the non-zero allocation.

Even using an unsigned value instead of a signed one for the `size`
variable caused issues, so switching to this is simpler.

gcc/rust/ChangeLog:

* expand/rust-proc-macro.cc: Use stringstream instead of sprintf.
* rust-system.h: Include <iomanip>.
gcc/rust/expand/rust-proc-macro.cc
gcc/rust/rust-system.h