Menu

#1791 complie error of invernal.c on MinGW64 32 bit build

None
closed-accepted
nobody
None
2016-05-13
2016-05-07
No

complie error of invernal.c on MinGW64 32 bit build

gcc -c -I/c/Programs/gplibs32_gcc530/include -fno-keep-inline-dllexport -D_FILE_OFFSET_BITS=64 -D__USE_MINGW_ANSI_STDIO -DDEFAULTTERM=\"wxt\" -DHAVE_FINDVERSION_H -m32 -O2 -pipe -I. -I../../src -I../../term/ -D_Windows -DHAVE_CONFIG_H -DPIPES -DWGP_CONSOLE -DCONSOLE_SWITCH_CP -D__USE_MINGW_ANSI_STDIO=1 -DGNUPLOT_SHARE_DIR=\"share\" -DDEVELOPMENT_VERSION -DUSE_MOUSE=1 -DWIN_IPC -I/c/Program\ Files\ \(x86\)/HTML\ Help\ Workshop/include -DHAVE_LIBGD -DHAVE_LIBPNG -DHAVE_LIBGD -DHAVE_GD_H -DHAVE_GD_GIF -DGIF_ANIMATION -DHAVE_GD_PNG -DHAVE_GD_JPEG -DHAVE_GD_TTF -DHAVE_CAIROPDF -DWXWIDGETS -DQTTERM -DQT_NO_OPENGL -DHAVE_LUA -DHAVE_LIBCACA -DHAVE_ICONV -DHAVE_LIBCERF -DNEED_CEXP  -MMD -MT 'internal.$(O)' -MF internal.d -o internal.co ../../src/internal.c
In file included from ../../src/internal.h:42:0,
                 from ../../src/internal.c:38:
../../src/syscfg.h:342:21: warning: '_matherr' redeclared without dllimport attribute: previous dllimport ignored [-Wattributes]
 # define GP_MATHERR _matherr
                     ^
../../src/internal.c:67:1: note: in expansion of macro 'GP_MATHERR'
 GP_MATHERR( STRUCT_EXCEPTION_P_X )
 ^
../../src/internal.c: In function '_matherr':
../../src/internal.c:68:1: error: number of arguments doesn't match prototype
 {
 ^
In file included from ../../src/stdfn.h:291:0,
                 from ../../src/internal.c:40:
C:/msys64_gcc530/mingw32/i686-w64-mingw32/include/math.h:286:23: error: prototype declaration
   _CRTIMP int __cdecl _matherr (struct _exception *);
#ifndef _WIN64
/*
 * FIXME: This is almost certainly out of date on linux, since the matherr
 * mechanism has been replaced by math_error() and supposedly is only 
 * enabled via an explicit declaration #define _SVID_SOURCE.
 */
/*
 * Excerpt from the Solaris man page for matherr():
 *
 *   The The System V Interface Definition, Third Edition (SVID3)
 *   specifies  that  certain  libm functions call matherr() when
 *   exceptions are detected. Users may define their own  mechan-
 *   isms  for handling exceptions, by including a function named
 *   matherr() in their programs.
 */

int
GP_MATHERR( STRUCT_EXCEPTION_P_X )
{
    return (undefined = TRUE);  /* don't print error message */
}
#endif

The part

int
GP_MATHERR( STRUCT_EXCEPTION_P_X )
{
    return (undefined = TRUE);  /* don't print error message */
}

shuold not be also applied MinGW64 32bit complier.

Thus

#ifndef _WIN64

shoule be modified.

However I have forgotten to proper altertive to excude also MinGW64 32bit complier.

Workaound is

#if 0 //workaround for MinGW64 32 bit compliler
#ifndef _WIN64
/*
 * FIXME: This is almost certainly out of date on linux, since the matherr
 * mechanism has been replaced by math_error() and supposedly is only 
 * enabled via an explicit declaration #define _SVID_SOURCE.
 */
/*
 * Excerpt from the Solaris man page for matherr():
 *
 *   The The System V Interface Definition, Third Edition (SVID3)
 *   specifies  that  certain  libm functions call matherr() when
 *   exceptions are detected. Users may define their own  mechan-
 *   isms  for handling exceptions, by including a function named
 *   matherr() in their programs.
 */

int
GP_MATHERR( STRUCT_EXCEPTION_P_X )
{
    return (undefined = TRUE);  /* don't print error message */
}
#endif
#endif // #if 0

Of cource this is temporal, so I will search the proper way.

Discussion

  • Tatsuro MATSUOKA

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -45,15 +45,27 @@
     #endif
     ~~~
    
    +The part
    +~~~
    +int
    +GP_MATHERR( STRUCT_EXCEPTION_P_X )
    +{
    +    return (undefined = TRUE); /* don't print error message */
    +}
    +~~~
    +
    +shuold not be also applied MinGW64 32bit complier.
    +
    +Thus
     ~~~
     #ifndef _WIN64
     ~~~ 
    
    -shoud not be applied MinGW64 32bit complier so that #ifndef _WIN64 shoule be modified.
    +shoule be modified.
    
    -However I have forgotten to proper derective to excude MinGW64 32bit complier.
    +However I have forgotten to proper altertive to excude also  MinGW64 32bit complier.
    +
     Workaound is 
    -
     ~~~
     #if 0 //workaround for MinGW64 32 bit compliler
     #ifndef _WIN64
    @@ -80,5 +92,4 @@
     #endif
     #endif // #if 0
     ~~~.
    -
    -I will search the proper way.
    +Of cource this is temporal, so I will search the proper way.
    
    • Group: -->
    • Priority: -->
     
  • Tatsuro MATSUOKA

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -66,6 +66,7 @@
     However I have forgotten to proper altertive to excude also  MinGW64 32bit complier.
    
     Workaound is 
    +
     ~~~
     #if 0 //workaround for MinGW64 32 bit compliler
     #ifndef _WIN64
    @@ -91,5 +92,6 @@
     }
     #endif
     #endif // #if 0
    -~~~.
    +~~~
    +
     Of cource this is temporal, so I will search the proper way.
    
     
  • Tatsuro MATSUOKA

    --- a/src/internal.c    2016-04-27 01:46:22.000000000 +0900
    +++ b/src/internal.c    2016-05-08 16:09:44.181377500 +0900
    @@ -47,7 +47,7 @@
    
     #include <math.h>
    
    -#ifndef _WIN64
    +#if !defined (_WIN64) && !defined (__MINGW64_VERSION_MAJOR)
     /*
      * FIXME: This is almost certainly out of date on linux, since the matherr
      * mechanism has been replaced by math_error() and supposedly is only 
    

    __MINGW64_VERSION_MAJOR indecates MinGW w64 regardless 32 bit or 64 bit

     
  • Tatsuro MATSUOKA

    This is off topic but releted to MinGW 32 bit build for QT.

    --- a/config/mingw/Makefile    2016-04-22 08:42:14.000000000 +0900
    +++ b/config/mingw/Makefile    2016-05-12 07:44:09.073270300 +0900
    @@ -109,8 +109,12 @@
     ifndef MINGW64
     QT_DIR = /d/Source/Qt-5.2.1-mingw/5.2.1/mingw48_32
     else
    +ifdef M32
    +QT_DIR = /mingw32
    +else
     QT_DIR = /mingw64
     endif
    +endif
    

    The above adds the consistency to the treatment on EXTRADIST in config/mingw/Makefile.

     
  • Tatsuro MATSUOKA

    I have created a pacth that inclues two modifications and attached it.

     
  • Bastian Märkisch

    • status: open --> closed-accepted
     
  • Bastian Märkisch

    Both applied to CVS. I also re-enabled it for MSVC in any case, since there it is actually supported.

     

Log in to post a comment.

MongoDB Logo MongoDB