c++/7178: "CONST" pre-processed to "const" -- case problem (pre-processing bug)

Danny Smith danny_r_smith_2001@yahoo.co.nz
Tue Jul 2 01:36:00 GMT 2002

>Number:         7178
>Category:       c++
>Synopsis:       "CONST" pre-processed to "const" -- case problem
(pre-processing bug)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 01 12:46:07 PDT 2002
>Originator:     Nickolai Dobrynin, University of WI-Milwaukee
>Release:        gcc version 3.1
  Windows 2000 Pro, Pentium 3, Dell Dimension

  the options given when GCC was configured/built:
    Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as
    mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls
    -languages=f77,c++,objc,ada --disable-win32-registry --disable-shared

  the compiler output (error messages, warnings, etc.):
    bug1.cpp:7: declaration does not declare anything
    bug1.cpp:7: duplicate `const'
    bug1.cpp:7: storage class specified for typename
    bug1.cpp:7: parse error before `=' token
    bug1.cpp: In function `int main()':
    bug1.cpp:18: parse error before `const'

This arises from the inclusion of windows.h by gthr-win32.h.  This leads to
this define in windef.h:

#ifndef CONST
#define CONST const

The pollution by win32 api names can be avoided in GCC 3.2 by defining

see this patch:

The patch has been backported to gcc-3_1-cygwin-mingw-branch.


http://www.sold.com.au - SOLD.com.au
- Find yourself a bargain!

More information about the Gcc-bugs mailing list