Problem 1410 - anachronistic old-style base class initializer in G4UItokenNum.hh
Summary: anachronistic old-style base class initializer in G4UItokenNum.hh
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: intercoms (show other problems)
Version: 9.6
Hardware: SGI Linux
: P5 normal
Assignee: Koichi Murakami
URL:
Depends on:
Blocks:
 
Reported: 2012-12-15 12:34 CET by Iwan Cornelius
Modified: 2013-02-06 11:13 CET (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Iwan Cornelius 2012-12-15 12:34:03 CET
A few errors were encountered during build of geant4.9.6. 

Architecture is: 
gcc -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.3 --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) 



The problems lie in the file:

G4UItokenNum.hh

First is a warning:
G4UItokenNum.hh:64:14: warning: imaginary constants are a GCC extension

Second is an error: 
G4UItokenNum.hh:68: error: anachronistic old-style base class initializer


Warning and error are avoided if struct yystype definition is modified to remove variable name 'I' and base class initializer; ie,.  

typedef struct yystype
{
    tokenNum type;
    G4double D;
    G4int    In;
    char     C;
    G4String S;

    yystype() 
    {
        type=NONE;
        D=0.0;
        In = 0;
        C = ' ';
        S="";
    }
    G4int operator==(const yystype& right) const
    {
      return (this == &right)?1:0;
    }
    yystype& operator=(const yystype& right)
    {
      if (&right==this) return *this;
      type = right.type;
      D = right.D;
      In = right.In;
      C = right.C;
      S = right.S;
      return *this;
    }
    yystype(const yystype& right)
    {
      *this=right;
    }
} yystype;


Hope this helps! 

Best Regards, 
Iwan
Comment 1 Koichi Murakami 2012-12-20 11:17:47 CET
I also checked on SUSE linux. The build works without any warnings and errors.

# gcc -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.3 --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=x86_64-suse-linux
Thread model: posix
gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux)
Comment 2 Iwan Cornelius 2013-01-30 16:29:43 CET
I believe the problem arose from use of the 'I' variable name in G4UItokenNum, something to do with Complex Numbers GNU extensions perhaps? 

Anyway, just wanted to let you know that I fixed the problem by adding 
#undef I 

at line 60 of G4UItokenNum.hh


Regards, 
Iwan
Comment 3 turks.jpg 2013-02-06 11:13:55 CET
Bug was encountered in Linux Mint 13 with the following g++ build:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)