#223 (expat 1.95.5) 'const' keyword

Feature Request
closed-rejected
nobody
None
5
2003-01-21
2002-11-26
Artyom Bolgar
No

Not all C-compilers knows the 'const' keyword
(especially old ones). That is why I propse to add the
following lines into expat.h file:

#ifndef __cplusplus
#define const
#endif

It defines 'const' as empty identifier and everything is
compiled OK. I attached the diff file for 1.95.5.
Thanks.

Discussion

  • Artyom Bolgar
    Artyom Bolgar
    2002-11-26

     
    Attachments
  • Artyom Bolgar
    Artyom Bolgar
    2002-11-26

    Logged In: YES
    user_id=657326

    More exactly, will be better to change it to:

    #ifdef XML_NOCONST
    #define const
    #endif

    I guess.

     
    • milestone: --> Feature Request
     
  • Logged In: YES
    user_id=3066

    What C compilers don't support "const"? That's not exactly a
    recent addition. Unless you can make the case that there
    are important platforms which can't be supported at all (with
    any compiler) without this, I'll reject it. It just doesn't make a
    lot of sense to support C implementations that don't comply
    with at least C89.

     
  • Artyom Bolgar
    Artyom Bolgar
    2002-11-27

    Logged In: YES
    user_id=657326

    I seem to recall the xlc compiler on the IBM AIX box.

     
  • Karl Waclawek
    Karl Waclawek
    2002-11-27

    Logged In: YES
    user_id=290026

    But is xlc the only C compiler for AIX?
    A quick google search turned up:

    - IBM C for AIX
    - VisualAge C++ for AIX
    - gcc (version 2.9.aix51.020209 )
    - XL C for AIX (seems to have a C89 compliance option)

     
  • Artyom Bolgar
    Artyom Bolgar
    2002-11-28

    Logged In: YES
    user_id=657326

    Well, I have to check it out to be sure. I'll post an additional
    info later.

     
  • Logged In: YES
    user_id=3066

    Since "const" is ANSI C and additional information has not
    been provided, I'm closing this report.

     
    • status: open --> closed-rejected