Re: What's the best way to fix warnings from unused result

2019-04-08 Thread Eric S. Raymond via devel
Fred Wright via devel : > > This is probably what you want: > > > > ./include/ntp_stdlib.h:162:#define IGNORE(r) do{if(r){}}while(0) > > Does a simple void cast work? E.g.: > > (void) strerror_r(...) > > It certainly works for unused function arguments, and it's an actual > official lang

Re: What's the best way to fix warnings from unused result

2019-04-07 Thread Fred Wright via devel
On Sun, 7 Apr 2019, Hal Murray wrote: Does a simple void cast work? E.g.: (void) strerror_r(...) I haven't found the magic using that approach. ../../ntpd/nts.c:214:16: warning: ignoring return value of ???strerror_r???, declared with attribute warn_unused_result [-Wunused-result]

Re: What's the best way to fix warnings from unused result

2019-04-07 Thread Hal Murray via devel
> Does a simple void cast work? E.g.: > (void) strerror_r(...) I haven't found the magic using that approach. ../../ntpd/nts.c:214:16: warning: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Wunused-result] (void) strerror_r(errno, errbu

Re: What's the best way to fix warnings from unused result

2019-04-07 Thread Fred Wright via devel
On Sun, 7 Apr 2019, Eric S. Raymond via devel wrote: Hal Murray via devel : ../../ntpd/nts.c:213:9: warning: ignoring return value of ???strerror_r???, declared with attribute warn_unused_result [-Wunused-result] I'm only getting this on Ubuntu, so a secondary question is why isn't that check

Re: What's the best way to fix warnings from unused result

2019-04-07 Thread Eric S. Raymond via devel
Hal Murray : > > e...@thyrsus.com said: > > Probablty compiler version. As GCC has evolved it has gotten stricter about > > this sort of thing. > > Fedora 29, no warnings: > gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2) > > Ubuntu 18.10, warnings > gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0 > > Ubuntu 18.

Re: What's the best way to fix warnings from unused result

2019-04-07 Thread Hal Murray via devel
e...@thyrsus.com said: > Probablty compiler version. As GCC has evolved it has gotten stricter about > this sort of thing. Fedora 29, no warnings: gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2) Ubuntu 18.10, warnings gcc (Ubuntu 8.2.0-7ubuntu1) 8.2.0 Ubuntu 18.04.2 LTS, warnings gcc (Ubuntu 7.3.0

Re: What's the best way to fix warnings from unused result

2019-04-07 Thread Achim Gratz via devel
Hal Murray via devel writes: > I don't know or care which version we get. It's different on different > systems, so to save the result then say UNUSED_LOCAL gets slightly > complicated. --8<---cut here---start->8--- Feature Test Macro Requirements for glibc

Re: What's the best way to fix warnings from unused result

2019-04-07 Thread Eric S. Raymond via devel
Hal Murray via devel : > ../../ntpd/nts.c:213:9: warning: ignoring return value of ‘strerror_r’, > declared with attribute warn_unused_result [-Wunused-result] > > I'm only getting this on Ubuntu, so a secondary question is why isn't that > check happening on other systems? Probablty compil

What's the best way to fix warnings from unused result

2019-04-06 Thread Hal Murray via devel
../../ntpd/nts.c:213:9: warning: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Wunused-result] I'm only getting this on Ubuntu, so a secondary question is why isn't that check happening on other systems? >From the man page: int strerror_r(int er