[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ncurses-bug
Subject:    Re: attr_get warning when on ubuntu 13.04
From:       Gaute Hope <eg () gaute ! vetsj ! com>
Date:       2013-12-15 10:46:15
Message-ID: 1387104229-sup-6885 () qwerzila
[Download RAW message or body]

[Attachment #2 (--=-1387104375-235909-21692-1718-2-=)]


Excerpts from Thomas Dickey's message of 2013-12-14 20:45:26 +0100:
> On Sat, Dec 14, 2013 at 11:18:30AM +0100, Gaute Hope wrote:
> > Greetings,
> > 
> > I'm getting some compiler warnings when using attr_get and wattr_get on
> > Ubuntu 13.04 which I don't get elsewhere:
> > 
> >   warning: the compariosn will always evaluate as 'true' for the address
> >   of 'attrs' will never be NULL [-Waddress]
> >   warning: the comparison will always evaluate as 'true' for the address
> >   of 'pair' will never be NULL [-Waddress]
> > 
> >   (gcc 4.7.3)
> 
> Actually it's the compiler version.  I fix the ones that I can, and (within
> reason), tweak the macros to help appease the compiler.  But this particular
> one is from compiler warning changes for a rather old macro - it's checked
> its parameters to ensure they are not-null since 1998.
>  
> > this is with code that goes like this:
> > 
> >   attr_t attrs = 0;
> >   short  pair  = 0;
> >   int ret = attr_get(&attrs, &pair, 0);
> > 
> > I am guessing the macros have been tweaked between the ncurses versions,
> > can you confirm this?
> 
> You can work around it by telling the compiler to use the actual function
> rather than the macro.  Do that by putting the name in parentheses, e.g.,
> 
>     int ret = (attr_get)(&attrs, &pair, 0);

Ok, thanks for the explanation. I assume the error will go away with
the next version upgrade on Ubuntus part.

Cheers, Gaute

 

["signature.asc" (signature.asc)]

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJSrYh3AAoJEJgnp+igdJAjnasP/jMWdoosb4J2B3b79JjaYcOF
/Dgh9hR5nVfY1FZYwfjRSZZKawWxbYerCKmexA8YnfdrkZRgbp8mdPsZouLanFe8
4m98Lj9EivYgqHBDE4LiNZkgAA6BpUlXbIht4nIjO87GWMDtPSE4Hi2qKQUgI+br
JAh2AOgMPjcyzRUGV67JVbLPvr1IsyJQ2GEkMmNlzE17/o8hz2pvAWuch1bwn5ot
AOKcHWBAI1fVub4/FOpTQYNlQpRgx7nv53MjkKiFdwm4xpltM61Lh61kjDiRCNuC
I8dmCIVCDMqMA4e0v10P6pubJ/grKCaVvkKKxHrbczqyuuDVd+3rZYrXgFOWgVVj
uQSpLcCYgnx8htfgWlwozJtzSEhiZSnRfHjWX4w+9JclIiSWlQfbvDXUf1shW4gn
v1hH83ERKsqwsmruvf22Mt1wrmUIE1qxO1quQr9bMo7ylBhoZb2L+7wspA0Ea1H9
zCfx7y0/c2uks/wNvX3KqHHPsdX3BCLkm+HRIKzb7XXS2z5hDIIwnwAQCw//PlE2
RQujXcTBcsE7N0jdkCQEwqHZKFH00LDAU7KC5Qnp1iPr4BIz3ulWBx/poNId66It
RnG/U5cyWdFHlXediMUE8/uMITSZqST5mazbd7FSyWdhWdK0YnXpoGPnxO0YduuJ
jyFSwbvHzJFXHjACJxj2
=z52w
-----END PGP SIGNATURE-----


_______________________________________________
Bug-ncurses mailing list
Bug-ncurses@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-ncurses


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic