something
something copied to clipboard
Compilation error (warning treated as error)
I get this error when trying to compile the game with make -B.
It gives a usable something.debug but no something.release.
OS: Arch linux
GCC: 10.2.0
In file included from src/something.cpp:14:
src/aids.hpp: In function ‘void command_history(Game*, aids::String_View)’:
src/aids.hpp:574:25: error: ‘snprintf’ argument 4 may overlap destination object ‘game’ [-Werror=restrict]
574 | int n = snprintf(
| ~~~~~~~~^
575 | buffer->data + buffer->size,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
576 | buffer->capacity - buffer->size,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
577 | "%.*s", (int) view.count, view.data);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/something.cpp:57:
src/something_commands.cpp:153:28: note: destination object referenced by ‘restrict’-qualified argument 1 was declared here
153 | void command_history(Game *game, String_View)
| ~~~~~~^~~~
cc1plus: all warnings being treated as errors
make: *** [Makefile:21: something.release] Error 1
@apa420 this is a really weird error... Is it reproducible with clang?
I do not get this error with clang version 10.0.1