[Expat-bugs] [ expat-Bugs-846309 ] warning: `cdecl' attribute directive ignored

SourceForge.net noreply at sourceforge.net
Wed Jan 14 01:44:49 EST 2004


Bugs item #846309, was opened at 2003-11-20 17:59
Message generated for change (Comment added) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=846309&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Peter Handel (phandel)
Assigned to: Nobody/Anonymous (nobody)
Summary: warning: `cdecl' attribute directive ignored

Initial Comment:
Noticed the following warnings while compiling with expat:

warning: `cdecl' attribute directive ignored

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2004-01-13 22:44

Message:
Logged In: NO 

Hi there,

I tried it on Solaris 2.9, gcc-3.3 (sunfreeware) and make-3.80 
(sunfreeware) and got a lot of these warnings.

steps were
./configure
make
make check also generates the errors and fails:
[...snip..]
lib/expat.h:985: warning: `cdecl' attribute directive ignored
/bin/bash ./libtool --silent --mode=link gcc -g -O2 -Wall -
Wmissing-prototypes -Wstrict-prototypes -fexceptions -
DHAVE_EXPAT_CONFIG_H   -I./lib -I.  -o tests/runtests 
tests/runtests.o tests/chardata.o libexpat.la -lcheck
tests/runtests
ld.so.1: runtests: fatal: libexpat.so.0: open failed: No such 
file or directory
make: *** [check] Killed

So I tried installing it via make install and then do another 
make check and that seems to work:

make check
tests/runtests
Expat version: expat_1.95.7
Running suite(s): basic
100%: Checks: 47, Failures: 0, Errors: 0

echo $LD_LIBRARY_PATH
/usr/local/lib:/usr/local/ssl/lib:/usr/lib

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2003-12-30 04:57

Message:
Logged In: NO 

This error occurs an all patforms which do not have an i386
processor.
>From GCC 3.3.2 manual:

`cdecl'
     On the Intel 386, the `cdecl' attribute causes the
compiler to
     assume that the calling function will pop off the stack
space used
     to pass arguments.  This is useful to override the
effects of the
     `-mrtd' switch.

The wrong statement is in lib/expat.h line 48

#elif defined(__GNUC__)
#define XMLCALL __attribute__((cdecl))

the #elif statement has to be defined as:
#elif defined(__GNUC__) && defined(__i386)
#define XMLCALL __attribute__((cdecl))

Regards


----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2003-12-16 20:31

Message:
Logged In: YES 
user_id=290026

According to the README the Check library is a pre-requisite
for building and running the test suite..

----------------------------------------------------------------------

Comment By: David Wheeler (wheeler)
Date: 2003-12-16 20:19

Message:
Logged In: YES 
user_id=309379

I don't think I do have it installed -- at least locate
doesn't seem to find it. But FYI, the tests, after issuing a
lot of warnings, end with this:

tests/runtests.c:1409: warning: implicit declaration of
function `srunner_run_all'
tests/runtests.c:1410: warning: implicit declaration of
function `srunner_ntests_failed'
tests/runtests.c:1411: warning: implicit declaration of
function `srunner_free'
tests/runtests.c:1412: warning: implicit declaration of
function `suite_free'
make: *** [tests/runtests.o] Error 1


----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2003-12-16 18:19

Message:
Logged In: YES 
user_id=290026

Do you have the Check library installed?
If yes, which tests does it fail?

----------------------------------------------------------------------

Comment By: David Wheeler (wheeler)
Date: 2003-12-16 13:22

Message:
Logged In: YES 
user_id=309379

No, i think the problem was that make test is designed to
run after make install in expat. I'd never heard of this
before. But now that it is installed, it of course still
fails tests. More on the issue here:

 
http://sourceforge.net/tracker/index.php?func=detail&aid=858740&group_id=17203&atid=414256

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2003-12-16 12:46

Message:
Logged In: NO 

PATH variable should point to /usr/local/ or try 
using ./configure --prefix=/usr/local/lib
and read the README


----------------------------------------------------------------------

Comment By: David Wheeler (wheeler)
Date: 2003-12-11 21:54

Message:
Logged In: YES 
user_id=309379

True enough. I thought it was failing because `make check`
was failing spectacularly, but it turns out that the same is
true of 1.95.5, which issues no warnings. I've now tried
1.95.7 with XML::Parser, and all its tests pass, so I'm happy.

Thanks,

David

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2003-12-11 21:46

Message:
Logged In: YES 
user_id=290026

The build should still succeed. Its only a warning.

----------------------------------------------------------------------

Comment By: David Wheeler (wheeler)
Date: 2003-12-11 15:01

Message:
Logged In: YES 
user_id=309379

I notice I get the same results with gcc 2.95.2, gcc3 (GCC)
3.1 20021003 (prerelease), and gcc-3.3 (GCC) 3.3 20030304
(Apple Computer, Inc. build 1495). Pity.

Regards,

David

----------------------------------------------------------------------

Comment By: David Wheeler (wheeler)
Date: 2003-12-11 14:55

Message:
Logged In: YES 
user_id=309379

Is there a workaround, in the meantime? I'm trying to get
expat built on Mac OS X 10.3 "Panther".

Thanks,

David

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2003-11-25 08:41

Message:
Logged In: NO 

The same warning occurs also with gcc on Solaris. Somewhat
annoying. it might be useful to try and compile a program
during configure to see whether the cdecl works.

----------------------------------------------------------------------

Comment By: Karl Waclawek (kwaclaw)
Date: 2003-11-20 18:08

Message:
Logged In: YES 
user_id=290026

Does gcc on MacOSX know about cdecl at all,
or does it just not understand the attribute directive?

----------------------------------------------------------------------

Comment By: Peter Handel (phandel)
Date: 2003-11-20 18:00

Message:
Logged In: YES 
user_id=152036

This was with MacOS X 10.3 Panther, with the built-in gcc.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=846309&group_id=10127



More information about the Expat-bugs mailing list