Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-436

[Linux] MB_LEN_MAX incorrect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 4.1.3
    • 4.2.0
    • 18. Language Support
    • None
    • gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)

    Description

      On my Linux system MB_LEN_MAX is normally defined to 16 but when I use the macro in a program compiled with stdcxx the macro evaluates to 1. The test case goes like this:

      $ cat test.cpp && make CPPOPTS="-DGETCONF_MB_LEN_MAX=`getconf MB_LEN_MAX`" test && ./test
      #include <assert.h>
      #include <limits.h>

      int main ()
      {
      assert (MB_LEN_MAX == GETCONF_MB_LEN_MAX);
      }
      gcc -c -I/home/mbrown/stdcxx/include/ansi -D_RWSTDDEBUG -I/home/mbrown/stdcxx/include -I/home/mbrown/stdcxx-gcc-4.1.1-11s/include -I/home/mbrown/stdcxx/examples/include -DGETCONF_MB_LEN_MAX=16 -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align test.cpp
      gcc u.o -o u -L/home/mbrown/stdcxx-gcc-4.1.1-11s/lib -lstd11s -lsupc++ -lm
      test: test.cpp:6: int main(): Assertion `1 == 16' failed.
      Aborted

      Attachments

        1. 18.limits.stdcxx-436.cpp
          2 kB
          Travis Vitek
        2. LIMITS.cpp.patch
          0.7 kB
          Travis Vitek
        3. stdcxx-436.patch
          0.7 kB
          Travis Vitek

        Activity

          People

            vitek Travis Vitek
            mbrown Mark Brown
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: