After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 168387 - gnome-program.c compile error
gnome-program.c compile error
Status: RESOLVED FIXED
Product: libgnome
Classification: Deprecated
Component: general
unspecified
Other Linux
: Immediate normal
: ---
Assigned To: libgnome maintainer
libgnome maintainer
: 168110 168859 169332 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2005-02-24 13:14 UTC by Benoît Dejean
Modified: 2005-03-05 21:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Handle both array and non-array va_list types. (941 bytes, patch)
2005-02-24 14:28 UTC, Benoît Dejean
none Details | Review
testcase (729 bytes, text/x-csrc)
2005-02-24 19:32 UTC, Benoît Dejean
  Details
proposed patch (2.03 KB, patch)
2005-02-24 19:32 UTC, Benoît Dejean
none Details | Review
updated (2.03 KB, patch)
2005-02-24 20:13 UTC, Benoît Dejean
none Details | Review
gnome-program-64bit.patch (736 bytes, patch)
2005-03-01 15:21 UTC, James Henstridge
none Details | Review

Description Benoît Dejean 2005-02-24 13:14:21 UTC
gnome-program.c: In function `gnome_program_init_paramv':
gnome-program.c:1931: error: invalid initializer


Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm
--enable-java-awt=xlib --enable-objc-gc --disable-multilib powerpc-linux
Thread model: posix
gcc version 3.3.5 (Debian 1:3.3.5-8)
Comment 1 Benoît Dejean 2005-02-24 13:52:07 UTC
the C99 rationale says :
« The va_list type is not necessarily assignable. However, a function can pass a
pointer to its initialized argument list object, as noted below. »
Comment 2 Benoît Dejean 2005-02-24 14:02:05 UTC
see http://gcc.gnu.org/ml/gcc-patches/2002-04/msg01195.html
Comment 3 Benoît Dejean 2005-02-24 14:28:58 UTC
Created attachment 37899 [details] [review]
Handle both array and non-array va_list types.
Comment 4 Benoît Dejean 2005-02-24 14:37:42 UTC
Comment on attachment 37899 [details] [review]
Handle both array and non-array va_list types.

bad patch
Comment 5 Kjartan Maraas 2005-02-24 15:45:20 UTC
Is there a good patch missing here? :-)
Comment 6 Benoît Dejean 2005-02-24 15:59:13 UTC
i took me some time to understand exactly the workaround provided on gcc's
bugzilla. But i still don't know how portably initialize an empty va_list. May
be it gnome_program_init_common should take a va_list* so we can pass it NULL ?
Comment 7 Kjartan Maraas 2005-02-24 16:09:19 UTC
There's a different bug report for this where someone reported that it compiled
fine when inited to = {}. Does that work for you too?
Comment 8 Benoît Dejean 2005-02-24 17:02:39 UTC
yes, but {} is not a valid initializer for scalar. If va_list is not an array
type, it's an error. I think that the main question is : is a zero-initialized
va_list a valid empty va_list ?
Comment 9 Sebastien Bacher 2005-02-24 18:17:04 UTC
no, libgnomeui 2.8.1 doesn't build on alpha because of that:
http://buildd.debian.org/fetch.php?&pkg=libgnome&ver=2.8.1-1&arch=alpha&stamp=1109255817&file=log&as=raw
Comment 10 Benoît Dejean 2005-02-24 19:32:01 UTC
Created attachment 37913 [details]
testcase
Comment 11 Benoît Dejean 2005-02-24 19:32:27 UTC
Created attachment 37914 [details] [review]
proposed patch
Comment 12 Benoît Dejean 2005-02-24 20:13:44 UTC
Created attachment 37916 [details] [review]
updated

replaced C99 va_copy by G_VA_COPY
Comment 13 Kjartan Maraas 2005-03-01 13:48:49 UTC
*** Bug 168110 has been marked as a duplicate of this bug. ***
Comment 14 Kjartan Maraas 2005-03-01 13:49:39 UTC
*** Bug 168859 has been marked as a duplicate of this bug. ***
Comment 15 James Henstridge 2005-03-01 15:21:55 UTC
Created attachment 38099 [details] [review]
gnome-program-64bit.patch

As I said in the other bug report, the only real problem here is that a code
analysis tools spit out a warning.

This is a minimal patch fixes the compile error, and adds a check to make
absolutely sure that "args" won't actually be used by
gnome_program_init_common().  The code analysis tools will probably still
complain though.

At this stage in the release process, a minimal patch is probably better than a
more extensive one like attachment 37916 [details] [review].
Comment 16 Kjartan Maraas 2005-03-01 20:19:31 UTC
Commited the simple fix.
Comment 17 Benoît Dejean 2005-03-01 21:12:04 UTC
It's still broken if someone changes the behaviour of
gnome_program_init_common(). Please add a comment/FIXME :)
Comment 18 Richard Hoelscher 2005-03-05 21:58:33 UTC
*** Bug 169332 has been marked as a duplicate of this bug. ***