• Travis Cross's avatar
    Handle gcc's overzealous unused-result warning · b874048e
    Travis Cross 提交于
    Modern static analyzers warn when a variable is set but not used.  GCC
    warns when the result of a function marked as
    `__attribute__((warn_unused_result))` is not set to some variable,
    even when the function is cast to `(void)`, which is the recognized
    way of indicating the intent to ignore the result.  We treat all
    warnings as errors.
    
    The combination of behaviors here makes it difficult if we really
    don't care about the result of the function; the obvious workarounds
    are precluded.
    
    GCC's maintainers don't consider this to be a bug:
    
      Why do you think this is a bug?  warn_unused_result is for cases where
      "not checking the result is either a security problem or always a
      bug".
    
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509#c1
    
    GLIBC however marks functions like `read` and `write` with this
    attribute.  While it certainly in most cases is correct to act on
    their return value, in some cases we really just don't care.
    
    So when we see that we're building with GCC, and that we're building
    with all warnings enabled, we'll just pass -Wno-unused-result to
    disable the warning.
    
    ref: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509
    ref: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
    b874048e
名称
最后提交
最后更新
build 正在载入提交数据...
clients/flex 正在载入提交数据...
cmake_modules 正在载入提交数据...
conf 正在载入提交数据...
debian 正在载入提交数据...
docs 正在载入提交数据...
dtd 正在载入提交数据...
fscomm 正在载入提交数据...
htdocs 正在载入提交数据...
html5/verto 正在载入提交数据...
libs 正在载入提交数据...
scripts 正在载入提交数据...
src 正在载入提交数据...
support-d 正在载入提交数据...
w32 正在载入提交数据...
web 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.mailmap 正在载入提交数据...
Freeswitch.2005.unsupported.sln 正在载入提交数据...
Freeswitch.2008.express.unsupported.sln 正在载入提交数据...
Freeswitch.2008.sln.debug.bat 正在载入提交数据...
Freeswitch.2008.sln.release.bat 正在载入提交数据...
Freeswitch.2008.unsupported.sln 正在载入提交数据...
Freeswitch.2010.express.sln 正在载入提交数据...
Freeswitch.2010.sln 正在载入提交数据...
Freeswitch.2012.sln 正在载入提交数据...
Freeswitch.2012.sln.bat 正在载入提交数据...
INSTALL 正在载入提交数据...
Makefile.am 正在载入提交数据...
acinclude.m4 正在载入提交数据...
bootstrap.sh 正在载入提交数据...
cc.sh 正在载入提交数据...
cluecon.tmpl 正在载入提交数据...
cluecon2.tmpl 正在载入提交数据...
cluecon2_small.tmpl 正在载入提交数据...
cluecon_small.tmpl 正在载入提交数据...
configure.ac 正在载入提交数据...
devel-bootstrap.sh 正在载入提交数据...
erlang.spec 正在载入提交数据...
freeswitch-config-rayo.spec 正在载入提交数据...
freeswitch-sounds-en-us-callie.spec 正在载入提交数据...
freeswitch-sounds-music.spec 正在载入提交数据...
freeswitch-sounds-ru-RU-elena.spec 正在载入提交数据...
freeswitch-sounds-sv-se-jakob.spec 正在载入提交数据...
freeswitch.spec 正在载入提交数据...
swig_common.i 正在载入提交数据...