Opened 15 years ago

Closed 15 years ago

Last modified 6 years ago

#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:


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)

0002-Fix-gcc-warnings-when-compiling-with-DFORTIFY_SOURC.patch (5.8 KB ) - added by SF/raorn 15 years ago.

Download all attachments as: .zip

Change History (10)

by SF/raorn, 15 years ago


comment:1 by fingolfin, 15 years ago

Owner: set to fingolfin

comment:2 by fingolfin, 15 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 fingolfin, 15 years ago

Status: newpending

comment:4 by SF/raorn, 15 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.


comment:5 by SF/raorn, 15 years ago

Status: pendingnew

comment:6 by sev-, 15 years ago

What is the status of this item?

comment:7 by fingolfin, 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 fingolfin, 15 years ago

Status: newclosed

comment:9 by digitall, 6 years ago

Component: Port: Linux
Note: See TracTickets for help on using tickets.