[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libcdio-devel] Re: Build obstacles and warnings from GNU/Linux and Free
From: |
Thomas Schmitt |
Subject: |
[Libcdio-devel] Re: Build obstacles and warnings from GNU/Linux and FreeBSD 8 |
Date: |
Tue, 11 May 2010 18:28:57 +0200 |
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]", \
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.
------------------------------------------------
> > /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 ?
------------------------------------------------
Have a nice day :)
Thomas