GNOME Bugzilla – Bug 143290
Build breaks due to "," at end of enum in gstreamer/gst/element/gsttypefind.c
Last modified: 2004-12-22 21:47:04 UTC
It is noted that gsttypefind.c has been renamed to gsttypefindelement.c and that this error persists in the CVS latest. Line 87 of gsttypefind.c contains an extraneous "," which breaks using the AIX native compiler with the diagnostic : gstreamer/gst/elements/gsttypefind.c", line 87.16: 1506-275 (S) Unexpected text ',' encountered. The enum concerned is : enum { MODE_NORMAL, /* act as identity */ MODE_TYPEFIND, /* do typefinding */ };
There is the same problem at lines ~85 and ~92 (version 0.8.1 and CVS latest) in source file gstreamer/gst/schedulers/gstbasicscheduler.c : typedef enum { GST_BASIC_SCHEDULER_STATE_NONE, GST_BASIC_SCHEDULER_STATE_STOPPED, GST_BASIC_SCHEDULER_STATE_ERROR, GST_BASIC_SCHEDULER_STATE_RUNNING, } GstBasicSchedulerState; typedef enum { /* something important has changed inside the scheduler */ GST_BASIC_SCHEDULER_CHANGE = GST_SCHEDULER_FLAG_LAST, } GstBasicSchedulerFlags;
i already fixed a bunch of those in gst-plugins last week, time to do the same for gstreamer core. please retry with latest CVS, commiting some fixes to gstreamer core now it is legal C99, but not legal C90. works ok with gcc, but not for Forte & AIX compiler (and some more i don't know) http://cia.navi.cx/stats/project/GStreamer/.message/1335952
Could I add that gstoptimalscheduler.c also has the "," at the end of 4 enums ? Also, through use of the macros GST_ELEMENT_SCHED_CONTEXT and GST_PAD_BUFLIST which include a cast, there are about 10 lines in error because of casting an lvalue (lefthand side). When I remove the casts from the macros, there are 2 lines in error where GST_PAD_BUFLIST is effectively needed with a cast (on the righthand side).
i already fixed the gstoptimalscheduler.c trailing commas (as in tee and md5sink elements) in the commit i did at comment #2 the full list of changed files/diff is : http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/elements/gstaggregator.c.diff?r1=1.33&r2=1.34 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/elements/gstfakesink.c.diff?r1=1.65&r2=1.66 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/elements/gstfakesrc.c.diff?r1=1.78&r2=1.79 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/elements/gstmd5sink.c.diff?r1=1.17&r2=1.18 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/elements/gstshaper.c.diff?r1=1.11&r2=1.12 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/elements/gsttee.c.diff?r1=1.49&r2=1.50 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/elements/gsttypefindelement.c.diff?r1=1.15&r2=1.16 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/schedulers/gstbasicscheduler.c.diff?r1=1.97&r2=1.98 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/schedulers/gstoptimalscheduler.c.diff?r1=1.79&r2=1.80 please open another bug for bugs not related to trailing commas (like those missing cast, and also cast as l-value)
any other occurence of this bug (tailing comma in enum) or are they all fixed ? if you don't report them, they won't be fixed (gcc doesn't see those like a problem as it is allowed by C99)
Michael, ping ?
Sorry for the delay in responding. I have been assigned to a different project and am no longer able to work on porting to AIX. Others on the team will eventually recopy the reference code and report new problems. Compiling in C99 is a future item for the project, but I have no specific information. Can we consider this defect as having been corrected ? Thanks.