[Csnd-dev] ignore_value
| Date | 2018-02-02 01:36 |
| From | Michael Gogins |
| Subject | [Csnd-dev] ignore_value |
GCC version 7 is now requiring GNUC library functions declared with
attribute to handle return values to compile with an error if the
return value is not referenced.
This is not uncommon in Csound. I have added a macro at the end of
include/sysdep.h to deal with this.
For example, instead of the following which with GCC 7 and -Werror
causes an error,
(void) fgets(buffer, 10, f);
use
ignore_value(fgets(buffer, 10, f));
It defaults to the original case for older or non-Gnu compilers.
Regards,
Mike
-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com |
| Date | 2018-02-02 07:57 |
| From | Victor Lazzarini |
| Subject | Re: [Csnd-dev] ignore_value |
Couldn’t IGN() be used? Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 2 Feb 2018, at 01:36, Michael Gogins |
| Date | 2018-02-02 09:09 |
| From | Michael Gogins |
| Subject | Re: [Csnd-dev] ignore_value |
Not for GCC 7. This has been an issue for a number of projects. Why would the code for ignore_value come from Gnu libc itself if there were not a real issue? On Feb 2, 2018 02:58, "Victor Lazzarini" <Victor.Lazzarini@mu.ie> wrote: Couldn’t IGN() be used? |
| Date | 2018-02-02 12:48 |
| From | John ff |
| Subject | Re: [Csnd-dev] ignore_value |
Does a cast to void not work? Sent from TypeApp On Feb 2, 2018, 09:09, at 09:09, Michael Gogins |
| Date | 2018-02-02 13:12 |
| From | Michael Gogins |
| Subject | Re: [Csnd-dev] ignore_value |
Obviously not. Best, Mike On Feb 2, 2018 07:48, "John ff" <jpff@codemist.co.uk> wrote: Does a cast to void not work? |