Package: libintelrdfpmath-dev
Version: 2.0u2-3
Severity: important
Tags: patch

Dear Maintainer,

If one compiles the attached C program on i386 or armhf, one gets:

In file included from wchar_t-bug.c:9:
/usr/lib/gcc/i686-linux-gnu/10/include/stddef.h:321:24: error: conflicting 
types for ‘wchar_t’
  321 | typedef __WCHAR_TYPE__ wchar_t;
      |                        ^~~~~~~
In file included from wchar_t-bug.c:7:
/usr/include/bid_functions.h:46:15: note: previous declaration of ‘wchar_t’ was 
here
   46 | typedef int   wchar_t;
      |               ^~~~~~~

The problem is that bid_functions.h comes with its own definition of wchar_t,
which conflicts with that of GCC.

Note that the problem does not occur on amd64 (I guess because the inclusion
chains are different, and wchar_t gets defined by GCC before bid_functions.h
tries to redefine it).

I attach a patch that solves the problem by simply unconditionnally including
wchar.h, instead of defining wchar_t.

Best,

--
⢀⣴⠾⠻⢶⣦⠀  Sébastien Villemot
⣾⠁⢠⠒⠀⣿⡁  Debian Developer
⢿⡄⠘⠷⠚⠋⠀  http://sebastien.villemot.name
⠈⠳⣄⠀⠀⠀⠀  http://www.debian.org
#define DECIMAL_CALL_BY_REFERENCE 1
#define DECIMAL_GLOBAL_ROUNDING 1
#define DECIMAL_GLOBAL_ROUNDING_ACCESS_FUNCTIONS 1
#define DECIMAL_GLOBAL_EXCEPTION_FLAGS 1
#define DECIMAL_GLOBAL_EXCEPTION_FLAGS_ACCESS_FUNCTIONS 1
#include <bid_conf.h>
#include <bid_functions.h>

#include <stddef.h>

int
main()
{
}
--- bid_functions.h.orig        2018-06-08 03:10:52.000000000 +0200
+++ bid_functions.h     2020-10-26 18:26:16.833114259 +0100
@@ -36,16 +36,9 @@
 #ifndef _BID_FUNCTIONS_H
 #define _BID_FUNCTIONS_H
 
-#if !defined (__GNUC__) || defined(__QNX__)
 #include <wchar.h>
-#endif
 #include <ctype.h>
 
-// Fix system header issue on Sun solaris and define required type by ourselves
-#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED) && !defined(__QNX__)
-typedef int   wchar_t;
-#endif
-
 
 #ifdef IN_LIBGCC2
 // When we are built as the part of the gcc runtime library, libgcc,

Reply via email to