libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libcdio-devel] Re: Build obstacles and warnings from GNU/Linux and


From: Rocky Bernstein
Subject: Re: [Libcdio-devel] Re: Build obstacles and warnings from GNU/Linux and FreeBSD 8
Date: Tue, 11 May 2010 13:57:30 -0400

On Tue, May 11, 2010 at 12:28 PM, Thomas Schmitt <address@hidden> wrote:

> Hi,
>
> > >  cdda-player.c:878: warning: the address of 'artist' will always
> evaluate
> > > as 'true'
>
> > Known about this for a while, but I don't know of a solution.
>
> This change in src/cdda-player.c , line 853
> silences the warning on FreeBSD 8-RELEASE and
> on 8-STABLE:
>
>  #define display_line(LINE_NO, COL_NO, format_str, field)   \
> -   if (field && field[0])  {                                \
> +   if (field != NULL && field[0])  {                        \
>      mvprintw(LINE_NO, COL_NO, (char *) format_str " [%s]", \
>

Ok. Simple enough. Applied.

>
> I would expect that only a real function instead
> of a macro would hide the fact that field is
> actually a static variable.
> So i guess it is just a gcc complaint about
> unclean C. (Since we do have NULL it is not clean
> to assume it to be equal to integer 0, is it ?)
>
> ------------------------------------------------
>
> > >  uint8_t book_version  : 4;
> > >  unsigned int book_version  : 4;
> > unsigned int is not necessarily the same as uint8_t and the field
> > represented is an 8-bit unsigned quantity.
>
> It is a 4-bit quantity.
> I assume the compiler packs it with neighboring
> bit fields or small integers into appropriate
> machine words.


> This here does not mention any integer type
> but only signedness:
>  http://publications.gbdirect.co.uk/c_book/chapter6/bitfields.html
> whereas this here follows my ideas:
>  http://en.wikipedia.org/wiki/C_syntax#Bit_fields
> According to
>
> http://publib.boulder.ibm.com/infocenter/lnxpcomp/v7v91/topic/com.ibm.vacpp7l.doc/language/ref/clrc03defbitf.htm
> the C99 standard requires bit-fields to work
> with _Bool, signed int, and unsigned int.
>

Ok. You convinced me. Changed.

>
> ------------------------------------------------
>
> > >  /usr/local/include/cdio/mmc.h:404: warning: comma at end of enumerator
> > > list
> > I like to have the comma at the end because it allows one to add to the
> list
> > without having to remember to add a comma.
>
> Doesn't the compiler remind us ?
>

It's the way it reminds you that is irksome. It reminds you by having the
compilation stop with an error. Then you have to change the program and
restart the build process which is generally via a more heavyweight make
mechanism that is doing lots of other stuff.

So I prefer a reminder that doesn't stop the build process over one that
does. There's probably some pragma that that will silence these kinds of GCC
warnings around this kind of code.

If someone comes up with that, I think that's the better route to go.


> ------------------------------------------------
>
> Have a nice day :)
>
> Thomas
>
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]