#8983 closed patch
gcc warnings with -DFORTIFY_SOURCE=2 -fstack-protector
Reported by: | SF/raorn | Owned by: | fingolfin |
---|---|---|---|
Priority: | normal | Component: | Port: Linux |
Version: | Keywords: | ||
Cc: | Game: |
Description
Fix gcc warnings when compiling with -DFORTIFY_SOURCE=2 -fstack-protector.
Some warnings may cause "glibc detected buffer overflow" runtime errors followed by abort(3).
Ticket imported from: #2684986. Ticket imported from: patches/1088.
Attachments (1)
Change History (10)
by , 16 years ago
Attachment: | 0002-Fix-gcc-warnings-when-compiling-with-DFORTIFY_SOURC.patch added |
---|
comment:1 by , 16 years ago
Owner: | set to |
---|
comment:2 by , 16 years ago
Thanks for your submission. The getcwd & strncat related fixes all make sense.
However, I wonder about the changes to write() calls in backends/midi/seq.cpp and backends/midi/timidity.cpp seem weird. Why would printing a warning if write returns a negative value improve anything? If these were errors, i.e., an "emergency bailout", I'd understand. But either those write failures are "harmless", and can be ignored (in particular, no warning), or they are not, and then they need to be handled.
So we applied the other changes, but I am very reluctant to apply the write() related ones.
comment:3 by , 16 years ago
Status: | new → pending |
---|
comment:4 by , 16 years ago
If it's "harmless", then it is possible to so something like:
(void) write(...);
just to STFU the compiler. It's mostly cosmetic changes.
Thanks.
comment:5 by , 16 years ago
Status: | pending → new |
---|
comment:7 by , 15 years ago
In my local git tree I have added the "(void)"s to silence the warnings. It's not yet in the main SVN tree, but will be soon.
comment:8 by , 15 years ago
Status: | new → closed |
---|
comment:9 by , 6 years ago
Component: | → Port: Linux |
---|
gcc-wanings.patch