[Freeassociation-devel] libical fixes suppress icalcomponent related warnings from -Wstrict-prototypes
Gren Elliot
gren.elliot at scalix.com
Thu Aug 6 07:43:02 PDT 2009
Hi again,
This patch stops warnings for missing prototypes related to
icalcomponent.h (I suspect the changes to the real functions in
icalcomponent.c are also required to signal that ANSI definitions rather
than K&R definitions are being used)
The problem is that for old style K&R definitions - there is no
provision for providing information on arguments to functions, so :
icalcomponent* icalcomponent_new_vcalendar();
gives you no information on the number of arguments.
In the brave new ANSI C world with prototypes, this leaves you with a
dilemma if you see a definition like that. Is it an old-style K&R
definition or does it mean that there are no arguments to the function?
The (perhaps inelegant) solution is that for good C99 code a function
that takes no arguments must be declared and defined with a void
argument list.
For example, for the compilation for the previous patch on Fedora 10,
you get :
gcc -g -o recurrenceNotExcluded -Wstrict-prototypes
-I/usr/include/libical -lical recurrenceNotExcluded.c
In file included from recurrenceNotExcluded.c:2:
/usr/include/libical/ical.h:3036: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3037: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3038: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3039: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3040: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3041: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3042: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3043: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3044: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3045: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3046: warning: function declaration isn’t a
prototype
In file included from recurrenceNotExcluded.c:2:
/usr/include/libical/ical.h:3492: warning: function declaration isn’t a
prototype
/usr/include/libical/ical.h:3733: warning: function declaration isn’t a
prototype
This won't fix all the warnings. My last patch in this series will
address the missing ones that I am aware of.
Regards,
Gren.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: icalcomponent-prototypes.patch
URL: <http://lists.infradead.org/pipermail/libical-devel/attachments/20090806/15a23f2d/attachment.ksh>
More information about the libical-devel
mailing list