diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-06-07 08:39:40 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-06-07 19:30:56 +0200 |
commit | d66fe0726bfb3fb1e3665f7e64b160440007d98e (patch) | |
tree | 412c984e0570580a2b2412740b1b050bc0a8f9a5 /refs.h | |
parent | builtin/merge: always store allocated strings in `pull_twohead` (diff) | |
download | git-d66fe0726bfb3fb1e3665f7e64b160440007d98e.tar.xz git-d66fe0726bfb3fb1e3665f7e64b160440007d98e.zip |
config.mak.dev: enable `-Wwrite-strings` warning
Writing to string constants is undefined behaviour and must be avoided
in C. Even so, the compiler does not help us with this by default
because those constants are not in fact marked as `const`. This makes it
rather easy to accidentally assign a constant to a non-const variable or
field and then later on try to either free it or write to it.
Enable `-Wwrite-strings` to catch such mistakes. With this warning
enabled, the type of string constants is changed to `const char[]` and
will thus cause compiler warnings when being assigned to non-const
fields and variables.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.h')
0 files changed, 0 insertions, 0 deletions