cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-2925747 ] stdint.h included in curlbuild.h not usable for C++ on IRIX

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sun, 14 Feb 2010 22:55:31 +0000

Bugs item #2925747, was opened at 2010-01-04 18:34
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2925747&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: compile or build problem
Group: portability problem
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: canavan (canavan)
Assigned to: Daniel Stenberg (bagder)
Summary: stdint.h included in curlbuild.h not usable for C++ on IRIX

Initial Comment:
On Irix, stdint.h explicitly prevents its use via an #error in anything but C99 mode, thereby preventing the use of curlbuild.h from C++. An easy fix would be to use inttypes.h instead if avaliable, possibly only in if __sgi is defined.

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

>Comment By: Daniel Stenberg (bagder)
Date: 2010-02-14 23:55

Message:
Let's just leave it like this until someone finds and reports a problem.
Case closed for now! Thanks!

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

Comment By: Yang Tse (yangtse)
Date: 2010-01-27 17:33

Message:
Currently the 'fix' living in CVS prevents inclusion of stdint.h on IRIX
systems for all compilers. The 'fix' is only required by MIPSpro 7.4.
Should we target only the specific compiler that requires the 'fix', or
leave it as is affecting all compilers on that platform?

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

Comment By: Daniel Stenberg (bagder)
Date: 2010-01-27 10:26

Message:
So guys, what's the current state of this in CVS?

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

Comment By: canavan (canavan)
Date: 2010-01-15 21:47

Message:
gcc apparently brings its own version of stdint.h. I'm not aware of any
compilers other than mipspro and gcc in general use on IRIX, so testing via
 defined(__sgi) && defined(__GNUC__) might be sufficient.

$ cc a.c -o a.out
cc-1035 cc: WARNING File = /usr/include/stdint.h, Line = 5
  #error directive: This header file is to be used only for c99 mode
          compilations

  #error This header file is to be used only for c99 mode compilations
   ^

$ /usr/nekoware/gcc-4.3/bin/gcc a.c -o a.out
$

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

Comment By: Yang Tse (yangtse)
Date: 2010-01-15 13:16

Message:
My biggest concern with the experimental patch, as it is right now, is that
it targets any compiler on the IRIX platform. I would be more comfortable
if we specifically targetted MIPSpro 7.4 series compiler.

Which is the behavior of the GNU C++ compiler relative to stdint.h on IRIX
?

Which other compilers can be used on IRIX, and what happens with stdint.h
?

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

Comment By: canavan (canavan)
Date: 2010-01-14 21:23

Message:
The C99-Compiler just happens to be my default compiler, mostly since it is
significantly more likely to be able to compile current open source
projects.

As far as I am aware, no further release or IRIX or MIPSPro are planned.

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

Comment By: Yang Tse (yangtse)
Date: 2010-01-14 19:23

Message:
Once more...

Why is IRIX MIPSPro 7.4 C compiler being used in C99 mode to build
libcurl?

Is there any technical or philosophical reason or advantage for doing so?

Is there any guarantee that newer IRIX MIPSPro C++ compilers will _never_
support inclusion of <stdint.h>?

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

Comment By: canavan (canavan)
Date: 2010-01-08 22:18

Message:
The workaround works as intended and disables STDINT_H on my test machine:

/* Configure process defines this to 1 when it finds out that system */
/* header file stdint.h must be included by the external interface. */
/* #undef CURL_PULL_STDINT_H */
#ifdef CURL_PULL_STDINT_H
# include <stdint.h>
#endif

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

Comment By: Yang Tse (yangtse)
Date: 2010-01-08 17:59

Message:
canavan,

Could you provide feedback on this issue?

Temporarily an experimental patch has been commited to CVS that should
prevent usage of stdint.h on IRIX
http://curl.haxx.se/cvs.cgi/curl/m4/curl-functions.m4?r1=1.61&r2=1.62

You can test this daily snapshot which includes the experimental patch
http://curl.haxx.se/snapshots/curl-7.20.0-20100108.tar.gz

An by all means, please show us the generated curlbuild.h with the patch
applied, and witout it.

I would also want to know if C99 is being used to build libcurl for some
partivular reason or it it is just a deault setting or whatever.

It is likely that in some future MIPSPro C++ tolerates stdint.h and the
experimental patch would be counterproductive.

Without feedback the experimental patch has the same probabilty of being
removed or not.

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

Comment By: Yang Tse (yangtse)
Date: 2010-01-05 15:01

Message:
In my entry with date 2010-01-05 13:45 all mentions of <inttypes.h> should
have been <stdint.h>

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

Comment By: Yang Tse (yangtse)
Date: 2010-01-05 14:45

Message:
My description of the issue:

1) IRIX MIPSpro C++ compiler can't use MIPSpro C99 header files.

2) When runing configure on IRIX using a MIPSpro C99 front end canavan
reports that the generated curlbuild.h includes header <inttypes.h>, this
allows proper compilation of libcurl and curl.

3) When attempting to use libcurl library built as described in point 2
above with a C++ program the IRIX MIPSpro C++ compiler chokes on
<inttypes.h> inclusion in curlbuild.h from the libcurl external API.

4) libcurl daily builds on IRIX using MIPSpro C compiler without
specification of C99 do not include <inttypes.h> in resulting curlbuild.h,
which proves that the inclusion of <inttypes.h> is triggered only when
using the C99 front end.

I would have no problem in saying that this is not a libcurl configure
problem. Configure is doing what it has been instructed to do, when using a
C compiler in C99 mode it may use C99 headers. If the library built in this
way is not interoperable from a C++ compiler that doesn't tolerate C99
headers and this is required, then C99 mode should have not been used to
configure the library. Its that simple.

In our usual tradition of trying to fix potential or real pitfalls we
could try to address the possibility that configure uses a C99 compiler and
that the library built in this way may not be usable from C++. This report
on IRIX MIPSpro has been the only notification of this kind of issue, but I
wouldn't be surprised if this also happens with other compiler suites on
other platforms.

So the question would be if we should address this in the broadest
possible way, or just for the IRIX MIPSpro compiler suite.

In any case, canavan, I would like to see the following three files:

1) The _full_ output when running the configure script redirected as
>config_c99.log 2>&1
2) Generated include/curl/curlbuild.h
3) Generated lib/curl_config.h

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

Comment By: Daniel Stenberg (bagder)
Date: 2010-01-04 23:03

Message:
ah... when you build your app you include libcurl headers with the other
compiler... ugh, that's a tricky problem. Yes we need some kind of run-time
check to cover for this, don't we Yang?

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

Comment By: Daniel Stenberg (bagder)
Date: 2010-01-04 23:02

Message:
doesn't that imply that you run configure with one CC and then build
(lib)curl with another CC?

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

Comment By: canavan (canavan)
Date: 2010-01-04 21:31

Message:
IRIX 6.5.30
Compiler is MIPSPro 7.4.4
CFLAGS=" -diag_suppress 3649 -diag_error 1035 -DIP32 -DIRIX -O3 -n32
-mips4 -OPT:Olimit=0:roundoff=3 -TARG:platform=IP27:proc=r10000
-L/usr/nekoware/lib -L/usr/local/lib -L/usr/lib32 -I/usr/nekoware/include
"

stdint.h is part of compiler_dev.hdr.lib, which is from the development
foundation 1.3 CD, which is required for the MIPSPro 7.4.x compilers.

The problem is that the configure script uses $CC to determine if stdint.h
is usable. With CC=/usr/bin/c99, this is a C99 compatible front-end. The
CXX=/usr/bin/CC however does not conform to C99, since it is a C++
compiler.

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

Comment By: Yang Tse (yangtse)
Date: 2010-01-04 20:31

Message:
Irix version ?
Compiler and version used when running configure ?
CC and CFLAGS used when running configure ?
AFAIK standard IRIX has no stdint.h, so where did that header come from ?

Answer all of the above.

In any case. If as you state, Irix stdint.h explicitly prevents its use
via an #error in anything but C99 mode, that means that you managed to run
configure in C99 mode, and afterwards when compiling your application you
are not using C99.

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=2925747&group_id=976
Received on 2010-02-14

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET