mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-01 11:01:46 +00:00
89efaed6b6
It's becoming increasingly difficult to ignore unwanted function returns in debug code with gcc. Now even when you try to work around it, it suggests a way to write your code differently. For example : src/frontend.c:187:65: warning: if statement has empty body [-Wempty-body] if (write(1, trash.str, trash.len) < 0) /* shut gcc warning */; ^ src/frontend.c:187:65: note: put the semicolon on a separate line to silence this warning 1 warning generated. This is totally unacceptable, this code already had to be written this way to shut it up in earlier versions. And now it comments the form ? What's the purpose of the C language if you can't write anymore the code that does what you want ? Emeric proposed to just keep a global variable to drain such useless results so that gcc stops complaining all the time it believes people who write code are monkeys. The solution is acceptable because the useless assignment is done only in debug code so it will not impact performance. This patch implements this, until gcc becomes even "smarter" to detect that we tried to cheat. |
||
---|---|---|
.. | ||
accept4.h | ||
appsession.h | ||
base64.h | ||
buffer.h | ||
cfgparse.h | ||
chunk.h | ||
compat.h | ||
compiler.h | ||
config.h | ||
debug.h | ||
defaults.h | ||
epoll.h | ||
errors.h | ||
hash.h | ||
memory.h | ||
mini-clist.h | ||
rbtree.h | ||
regex.h | ||
sessionhash.h | ||
splice.h | ||
standard.h | ||
syscall.h | ||
template.h | ||
ticks.h | ||
time.h | ||
tools.h | ||
uri_auth.h | ||
version.h |