bugGNU libunistring - Bugs: bug #45783, sparc64-sun-solaris2.9:...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #45783: sparc64-sun-solaris2.9: ./unistring/stdint.h:108:16: error: conflicting types for 'unistring_int8_t'

Submitter:  Marcin Cieślak <saper>
Submitted:  Mon 17 Aug 2015 07:36:13 PM UTC
   
 
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed

Mon 12 Dec 2016 09:36:22 AM UTC, comment #5: 

Great work Bruno to find out when GCC provides stdint.h. Of course this fix is better. I am wondering though whether the same approach should be applied for unistring/stdbool.h, which may also be provided by compiler.

Krzysztof Malinowski <raspy>
Sat 10 Dec 2016 10:34:25 AM UTC, comment #4: 

Thank you Marcin for the report, and thank you Krzysztof for the analysis.

Now fixed through http://git.savannah.gnu.org/gitweb/?p=libunistring.git;a=commitdiff;h=37a4dfd41674500647a0376d252ab8e8a5bfd118

Krzysztof, I agree with your analysis. But not with the fix: The comment in Makefile.am says that unistring/stdint.h should not be compiler dependent. Therefore it must not use the @HAVE_STDINT_H@ value from the configure run - because that would lead to wrong results when you build libunistring with GCC, then install it, then use it with 'cc' (or vice versa). Instead, I've used the fact that GCC produces its own <stdint.h> only starting with version 4.5.0.

Bruno Haible <haible>
Group administrator
Tue 05 Jan 2016 01:33:34 AM UTC, comment #3: 

Thank you. I think this patch solves the problem.

I am running into another autoconf related issue now, but that's another bug.

Marcin Cieślak <saper>
Tue 01 Dec 2015 10:33:08 AM UTC, comment #2: 

This issue happens when a compiler is used from non-standard location, like /home/admini/saper/sparcv7 in submitter's case. The root cause is that lib/Makefile.am performs its own test for existence of stdint.h (/usr/include/stdint.h to be exact) instead of getting configure's result. This test fails for Solaris 9 which does not have such header, yet the header is provided by GCC in a non-standard location (which configure correctly detects).

This leads to the following scenario:
- Makefile generates lib/unistring/stdint.h without HAVE_STDINT_H, which causes not to include system stdint.h
- When lib/uniname/uniname.c #includes <unistring/stdint.h> through its header and unitypes.h, system stdint.h does not get included, but unistring/stdint.h defines:
  * typedef signed char unistring_int8_t
  * #define int8_t unistring_int8_t
- When lib/uniname/uniname.c later #includes <stdint.h>, system (GCC's) stdint.h gets included, which contains the following:
  * typedef _INT8_TYPE_ int8_t
- Due to #define from unistring/stdint.h, this gets resolved to:
  * typedef char unistring_int8_t
  which is directly contradictory to typedef from unistring/stdint.h, hence the reported error.

As a precaution to handle such issue is to include system stdint.h before mangling with #defines for int8_t, which is handled correctly by lib/stdint.h, but not by lib/unistring/stdint.h due to differences in how those files are generated.

Attached is the proposed patch to generate lib/unistring/stdint.h based on configure's check results. It may also be desired to fix in a similar way tests for generating lib/unistring/stdbool.h, though current approach does not cause similar issue.


(file #35605)

Krzysztof Malinowski <raspy>
Mon 17 Aug 2015 07:53:19 PM UTC, comment #1: 

I have commented out

+verbose-
#define int8_t unistring_int8_t
-verbose-

and I could continue...

Marcin Cieślak <saper>
Mon 17 Aug 2015 07:36:13 PM UTC, original submission:  

Configure call:

 /home/admini/saper/src/libunistring-0.9.6/configure --prefix=/home/admini/saper/sparcv9 --with-libiconv-prefix=/home/admini/saper/sparcv9 CC="/home/admini/saper/sparcv7/bin/gcc -m64 -mcpu=ultrasparc3" --host=sparc64-sun-solaris2.9


Error message: (

Making all in lib
make[2]: Entering directory '/home/admini/saper/build/libunistring/lib'
/home/admini/saper/bin/make  all-am
make[3]: Entering directory '/home/admini/saper/build/libunistring/lib'
/bin/bash ../libtool  --tag=CC   --mode=compile /home/admini/saper/sparcv7/bin/gcc -m64 -mcpu=ultrasparc3 -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I/home/admini/saper/src/libunistring-0.9.6/lib -I..  -I. -I/home/admini/saper/src/libunistring-0.9.6/lib -I.. -I/home/admini/saper/src/libunistring-0.9.6 -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -D_REENTRANT  -g -O2 -c -o uniname/uniname.lo /home/admini/saper/src/libunistring-0.9.6/lib/uniname/uniname.c
libtool: compile:  /home/admini/saper/sparcv7/bin/gcc -m64 -mcpu=ultrasparc3 -DHAVE_CONFIG_H -DNO_XMALLOC -I. -I/home/admini/saper/src/libunistring-0.9.6/lib -I.. -I. -I/home/admini/saper/src/libunistring-0.9.6/lib -I.. -I/home/admini/saper/src/libunistring-0.9.6 -DIN_LIBUNISTRING -DDEPENDS_ON_LIBICONV=1 -D_REENTRANT -g -O2 -c /home/admini/saper/src/libunistring-0.9.6/lib/uniname/uniname.c  -fPIC -DPIC -o uniname/.libs/uniname.o
In file included from /home/admini/saper/src/libunistring-0.9.6/lib/unitypes.h:22:0,
                 from /home/admini/saper/src/libunistring-0.9.6/lib/uniname.h:22,
                 from /home/admini/saper/src/libunistring-0.9.6/lib/uniname/uniname.c:20:
./unistring/stdint.h:108:16: error: conflicting types for 'unistring_int8_t'
 #define int8_t unistring_int8_t
                ^
./unistring/stdint.h:106:21: note: previous declaration of 'unistring_int8_t' was here
 typedef signed char unistring_int8_t;
                     ^
Makefile:4106: recipe for target 'uniname/uniname.lo' failed
make[3]: * [uniname/uniname.lo] Error 1


Marcin Cieślak <saper>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #35605:  0001-Use-test-results-from-configure-instead-of-hardcoded-paths.patch added by raspy (2KiB - application/octet-stream - Proposed patch for Makefile.am)
file #34669:  stdint.h added by saper (5KiB - text/x-chdr - generated <stdint.h>)
file #34668:  libunistring-config.log added by saper (1MiB - text/x-log)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by raspy (Updated the item)
  • -email is unavailable- added by saper (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-12-10 haible StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed
    2016-11-24 haible CategoryNone Build
    2015-12-01 raspy Attached File- Added 0001-Use-test-results-from-configure-instead-of-hardcoded-paths.patch, #35605
    2015-08-17 saper Attached File- Added stdint.h, #34669
    2015-08-17 saper Attached File- Added libunistring-config.log, #34668

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code