You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Mark Brown (JIRA)" <ji...@apache.org> on 2007/06/05 06:25:00 UTC

[jira] Created: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

[Linux] MB_LEN_MAX incorrect
----------------------------

                 Key: STDCXX-436
                 URL: https://issues.apache.org/jira/browse/STDCXX-436
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 18. Language Support
    Affects Versions: 4.2
         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
            Reporter: Mark Brown


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


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525833 ] 

Travis Vitek commented on STDCXX-436:
-------------------------------------

I have one comment on this. Here is a quick summary of the problem.

  1. t.cpp includes <limits.h> which is actually our include/ansi/limits.h
  2. include/ansi/limits.h includes the gcc modified limits.h
  3. gcc modified limits.h attempts to use #include_next to include /usr/include/limits.h, but this actually gets include/ansi/limits.h again, which is a no-op because of the header guards.

The following is evidence of the include issue...

  [vitek@robot] 623 % cat t.cpp
  #include <limits.h>
  int main() { return 0; }

  [vitek@robot] 623 % g++ -H t.cpp
  . /amd/packages/mdx/redhat/em64t/compilers/gcc/3.4.6-3/bin/../lib/gcc/x86_64-redhat-linux/3.4.6/include/limits.h
  .. /amd/packages/mdx/redhat/em64t/compilers/gcc/3.4.6-3/bin/../lib/gcc/x86_64-redhat-linux/3.4.6/include/syslimits.h
  ... /amd/packages/mdx/redhat/em64t/compilers/gcc/3.4.6-3/bin/../lib/gcc/x86_64-redhat-linux/3.4.6/include/limits.h
  .... /usr/include/limits.h
  ..... /usr/include/features.h
  ...... /usr/include/sys/cdefs.h
  ...... /usr/include/gnu/stubs.h
  ..... /usr/include/bits/posix1_lim.h
  ...... /usr/include/bits/local_lim.h
  ....... /usr/include/linux/limits.h
  ..... /usr/include/bits/posix2_lim.h
  ..... /usr/include/bits/xopen_lim.h
  ...... /usr/include/bits/stdio_lim.h

  [vitek@robot] 624 % gmake CPPOPTS="-H" t
  gcc -c -I/amd/devco/vitek/stdcxx/trunk/include/ansi -D_RWSTDDEBUG   -pthread -I/amd/devco/vitek/stdcxx/trunk/include -I/nfs/devbuild/vitek/stdcxx/gcc-346/2007-09-07/include -I/amd/devco/vitek/stdcxx/trunk/tests/include -H -pedantic -nostdinc++ -g  -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align  t.cpp
  . /amd/devco/vitek/stdcxx/trunk/include/ansi/limits.h
  .. /amd/devco/vitek/stdcxx/trunk/include/rw/_defs.h
  ... /amd/devco/vitek/stdcxx/trunk/include/rw/_config.h
  .... /nfs/devbuild/vitek/stdcxx/gcc-346/2007-09-07/include/config.h
  .... /amd/devco/vitek/stdcxx/trunk/include/rw/_config-gcc.h
  .. /amd/packages/mdx/redhat/em64t/compilers/gcc/3.4.6-3/bin/../lib/gcc/x86_64-redhat-linux/3.4.6/include/../include/limits.h
  ... /amd/packages/mdx/redhat/em64t/compilers/gcc/3.4.6-3/bin/../lib/gcc/x86_64-redhat-linux/3.4.6/include/../include/syslimits.h
  .... /amd/devco/vitek/stdcxx/trunk/include/ansi/limits.h

So the problem that I see with the workaround for this issue is that anything included from /usr/include/limits.h is not seen when building using our headers. This would cause problems for a user program that depends on macros, functions, or types declared to be included from /usr/include/limits.h such as this one, 

#include <limits.h>
int main ()
{
    char host [HOST_NAME_MAX];
    return 0;
}

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment:     (was: stdcxx-436.patch)

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment:     (was: 18.limits.stdcxx-436.cpp)

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor reassigned STDCXX-436:
-----------------------------------

    Assignee: Martin Sebor

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.2
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Martin Sebor
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor resolved STDCXX-436.
---------------------------------

    Resolution: Fixed

Resolved by the committed patch: http://svn.apache.org/viewvc?rev=573904&view=rev.

Travis, can you put together a regression test suitable for our test suite?

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12523378 ] 

Martin Sebor commented on STDCXX-436:
-------------------------------------

Confirmed on Red Hat EL 4.4:

$ cat /etc/redhat-release && icc --version && make CPPOPTS="-DGETCONF_MB_LEN_MAX=`getconf MB_LEN_MAX`" t && ./t
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
icc (ICC) 10.0 20070613
Copyright (C) 1985-2007 Intel Corporation.  All rights reserved.

icc -c -I/amd/devco/sebor/stdcxx/include/ansi -D_RWSTDDEBUG   -D_REENTRANT -I/amd/devco/sebor/stdcxx/include -I/build/sebor/stdcxx-icc-10.0.025-15D/include -I/amd/devco/sebor/stdcxx/examples/include -DGETCONF_MB_LEN_MAX=16 -cxxlib-nostd -g   -w1   t.cpp
icc t.o -o t -cxxlib-nostd  -lpthread  -L/build/sebor/stdcxx-icc-10.0.025-15D/lib  -Wl,-R/build/sebor/stdcxx-icc-10.0.025-15D/lib -lstd15D -lcxaguard -lsupc++ -lm 
t: t.cpp:6: int main(): Assertion `1 == 16' failed.
Aborted


> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.2
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment: LIMITS.cpp.patch

Additional patch that appears to address the above mentioned issue.

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment: 18.limits.stdcxx-436.cpp

The attached patch includes a regression test for this issue. Unfortunately this test fails on windows due to what appears to be a configuration test error.

The LIMITS.cpp configuration test has a block that attempts to detect MB_LEN_MAX, and chooses an appropriate default if it is not found. On some platforms, it appears that limits.h is included indirectly via stdio.h. Because the test does not include limits.h explicitly MB_LEN_MAX is not always defined, and the 'appropriate' default value of 8 is incorrect on windows [at least on my 32-bit XP configuration].


> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment:     (was: LIMITS.cpp.patch)

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor updated STDCXX-436:
--------------------------------

         Priority: Critical  (was: Major)
    Fix Version/s: 4.2

This seems like a pretty serious problem that I think should be fixed for 4.2. Bumping up Priority and scheduled accordingly.

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Martin Sebor
>            Priority: Critical
>             Fix For: 4.2
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment: 18.limits.stdcxx-436.cpp

updated regression test.

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor updated STDCXX-436:
--------------------------------

    Affects Version/s:     (was: 4.2)
                       4.1.3

Also confirmed with 4.1.3 so it's not a regression. The problem doesn't exist on HP-UX or Solaris.

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Martin Sebor
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment: stdcxx-436.patch

Yes, I agree that it sounds like a bug when gcc include_next includes a file that has already been included. It looks like that include_next mechanism is a big kludge that has infected the system headers because there is a bunch of stink in /usr/include/limits.h related to it.

Here is an updated patch. I've tested it on linux/gcc and it still works. I guess if I were being picky I'd move this block inside the block that includes _RWSTD_ANSI_C_LIMITS_H, but I'm happy with it the way that it is if you are.

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor reopened STDCXX-436:
---------------------------------


Reopened until a corrected Windows patch is committed.

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor reassigned STDCXX-436:
-----------------------------------

    Assignee: Travis Vitek  (was: Martin Sebor)

Travis, can you please look into this when you have a moment?

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525864 ] 

Martin Sebor commented on STDCXX-436:
-------------------------------------

The fact that gcc's #include_next brings in a file that's already been included seems like a bug, don't you think?

About the patch, it looks good. Perhaps the only change we might want to consider is simplifying the preprocessor conditional to #if (MB_LEN_MAX != _RWSTD_MB_LEN_MAX). We should #define MB_LEN_MAX even (and especially) when it's not defined.


> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527355 ] 

Martin Sebor commented on STDCXX-436:
-------------------------------------

Travis, please attach a ChangeLog for the new LIMITS.cpp patch.

I'll hold off on committing the regression test until we settle the question here:
http://www.nabble.com/-jira--Created%3A-%28STDCXX-436%29--Linux--MB_LEN_MAX-incorrect-tf4386078.html


> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526969 ] 

Martin Sebor commented on STDCXX-436:
-------------------------------------

Also, it seems I missed the LIMITS.cpp.patch you added on 9/7. Now that I've looked at it I'm pretty sure it contains a typo in the preprocessor directive: #dlif?

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment: 18.limits.stdcxx-436.cpp

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment: LIMITS.cpp.patch

Fix typographical error in patches conditional code

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment:     (was: 18.limits.stdcxx-436.cpp)

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


RE: design of regression tests (was: Re: [jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect)

Posted by Farid Zaripov <Fa...@epam.com>.
> -----Original Message-----
> From: Travis Vitek [mailto:tvitek@quovadx.com] 
> Sent: Friday, September 14, 2007 10:46 AM
> To: stdcxx-dev@incubator.apache.org
> Subject: RE: design of regression tests (was: Re: [jira] 
> Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect)


> That said, I'm actually hoping to get feedback an the guts of 
> the test itself. It feels a bit fragile to me because it 
> compiles a separate executable to emulate getconf [for the 
> necessary constants only], and to do this I had to hardcode 
> the compiler names and flags into the test.
> I'm just hoping that this isn't something that will cause a 
> bunch of trouble in the future.

  The test relies on fact that cl.exe / icl.exe are accessible
through PATH environment variable, but it might be not true.

> If it looks fragile to you 
> guys, then maybe it would be best to just pass for windows 
> builds and invoke the system getconf as you suggested earlier 
> on other platforms.

  Once the 22.locale.messages.cpp test had compiled the message catalog
using rc.exe and link.exe on Windows... And now we have the util/gencat
utilty ;-)

Farid.

Re: design of regression tests

Posted by Martin Sebor <se...@roguewave.com>.
Travis Vitek wrote:
>  
[...]
>> The formatting code is also slightly buggy
>> because it doesn't account for integer promotion and sign extension.
>>
> 
> I'm not sure what you mean by this. Can you give an example of how this
> would be a problem?

This was a thinko on my part. We're not concerned about the formatting
of arbitrary character values (e.g., '\x80' and unexpectedly getting
back -128 instead of 128 when char is a signed type) but just the two
values, CHAR_MAX and CHAR_MIN, and we do expect to see the negative
value when CHAR_MIN is negative. Sorry about that!

Martin

RE: design of regression tests

Posted by Travis Vitek <tv...@quovadx.com>.
 
Martin Sebor wrote:
>
>I agree that it looks fragile, although I admit I am intrigued
>by the idea of programmatically invoking the compiler. I have
>been contemplating an API that would let us do this in general
>(i.e., build programs or even libraries, either using stdcxx
>or the native C++ Standard Library, or even C programs) but so
>far it's just an idea.
>
>Despite the fragility, I do see the appeal of this approach:
>unlike computing the constants directly in the test that I was
>at first inclined to suggest, it guarantees to yield the exact
>same values as the C library. (I assume that's why you chose
>it?) I suggest we keep the test in Jira and revisit it, maybe
>along withe the whole compiler API idea, when we have more
>time after the release.
>
>Some observations about the formatting code in the test:
>
>First, there's a macro for the "template <>" syntax to deal with
>outdated compiler: _RWSTD_SPECIALIZED_FUNCTION. We have been
>talking about dropping support for these kinds of workarounds at
>some point in the (near) future but we haven't actually done it
>yet. So until we do, we should continue to use these macros (if
>nothing else, it'll help us all appreciate the extent of these
>workarounds and decide which one we want to get rid of and which
>one we might want to keep).
>

Thanks, that may be useful for future reference.

>
>Second, this kind of type-based formatting is unnecessary. It would
>be sufficient to convert each constant to long and use %li or %lu
>to format them all. 
>

Yup, I realized that and wrote a new version of the test Friday night.
That simplifies things quite a bit.

>
>The formatting code is also slightly buggy
>because it doesn't account for integer promotion and sign extension.
>

I'm not sure what you mean by this. Can you give an example of how this
would be a problem?

Re: design of regression tests

Posted by Martin Sebor <se...@roguewave.com>.
Travis Vitek wrote:
>  
[...]
> I'm onboard with reducing the scope of this test to just verify
> MB_LEN_MAX and creating a new test for verifying all of the required
> limits.

Okay, let's do that then.

> 
> That said, I'm actually hoping to get feedback an the guts of the test
> itself. It feels a bit fragile to me because it compiles a separate
> executable to emulate getconf [for the necessary constants only], and to
> do this I had to hardcode the compiler names and flags into the test.
> I'm just hoping that this isn't something that will cause a bunch of
> trouble in the future. If it looks fragile to you guys, then maybe it
> would be best to just pass for windows builds and invoke the system
> getconf as you suggested earlier on other platforms.

I agree that it looks fragile, although I admit I am intrigued
by the idea of programmatically invoking the compiler. I have
been contemplating an API that would let us do this in general
(i.e., build programs or even libraries, either using stdcxx
or the native C++ Standard Library, or even C programs) but so
far it's just an idea.

Despite the fragility, I do see the appeal of this approach:
unlike computing the constants directly in the test that I was
at first inclined to suggest, it guarantees to yield the exact
same values as the C library. (I assume that's why you chose
it?) I suggest we keep the test in Jira and revisit it, maybe
along withe the whole compiler API idea, when we have more
time after the release.

Some observations about the formatting code in the test:

First, there's a macro for the "template <>" syntax to deal with
outdated compiler: _RWSTD_SPECIALIZED_FUNCTION. We have been
talking about dropping support for these kinds of workarounds at
some point in the (near) future but we haven't actually done it
yet. So until we do, we should continue to use these macros (if
nothing else, it'll help us all appreciate the extent of these
workarounds and decide which one we want to get rid of and which
one we might want to keep).

Second, this kind of type-based formatting is unnecessary. It would
be sufficient to convert each constant to long and use %li or %lu
to format them all. The formatting code is also slightly buggy
because it doesn't account for integer promotion and sign extension.
At least one of the conversion specifications (%hc) is also not
defined.

Martin

RE: design of regression tests (was: Re: [jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect)

Posted by Travis Vitek <tv...@quovadx.com>.
 

Martin Sebor wrote:
>
>Travis, all,
>
>I'm trying to decide how we should treat the latest regression test
>for STDCXX-436:
>
>http://issues.apache.org/jira/secure/attachment/12365789/18.limits.stdc
xx-436.cpp
>
>Up until now our approach to "designing" regression tests has been
>to simply copy the test case from each issue into the test suite
>with only a minimum of changes. The test you've added goes far
>beyond that, which makes it valuable because none of the other
>macros is being tested, but at the same time it marks quite the
>radical departure from the approach taken in all the other tests
>which I hesitate to make without bringing it for discussion first.
>

Yes. I noticed that none of the other macros were being tested of this
same issue, so I just lumped them all in there to avoid writing a test
that was just a copy/paste of this one.

>
>On the one hand, when an issue comes in that points out a problem
>with a feature so closely related to one or more others it makes
>perfect sense to make sure that (and add tests for) the other
>related features aren't broken, too. On the other hand, the name
>of each regression test clearly indicates which bug it is designed
>to exercise and when it should fail for some other reason (e.g.,
>a regression in one of the other related macros) it would mislead
>one into thinking that there's a problem with MB_LEN_MAX.
>

Agreed.

>
>I suppose that my view on this is in cases like this, when the
>bug report highlights a whole slew of features that aren't being
>tested we should add an ordinary (unit) test for the whole area
>and, if possible, also a regression test just for the bug. My
>rationale for keeping the two separate (even at the cost of
>duplicating some tested functionality) is that the bigger unit
>test is more likely to be enhanced or tweaked in the future and
>thus more likely to be subject to accidentally removing the test
>for the bug (or otherwise "regressing"), while the regression
>test is much more likely to be left  alone and consequently less
>prone to such accidental regressions.
>
>Opinions? Comments? Thoughts?
>

I'm onboard with reducing the scope of this test to just verify
MB_LEN_MAX and creating a new test for verifying all of the required
limits.

That said, I'm actually hoping to get feedback an the guts of the test
itself. It feels a bit fragile to me because it compiles a separate
executable to emulate getconf [for the necessary constants only], and to
do this I had to hardcode the compiler names and flags into the test.
I'm just hoping that this isn't something that will cause a bunch of
trouble in the future. If it looks fragile to you guys, then maybe it
would be best to just pass for windows builds and invoke the system
getconf as you suggested earlier on other platforms.

Travis

Travis

design of regression tests (was: Re: [jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect)

Posted by Martin Sebor <se...@roguewave.com>.
Travis, all,

I'm trying to decide how we should treat the latest regression test
for STDCXX-436:

http://issues.apache.org/jira/secure/attachment/12365789/18.limits.stdcxx-436.cpp

Up until now our approach to "designing" regression tests has been
to simply copy the test case from each issue into the test suite
with only a minimum of changes. The test you've added goes far
beyond that, which makes it valuable because none of the other
macros is being tested, but at the same time it marks quite the
radical departure from the approach taken in all the other tests
which I hesitate to make without bringing it for discussion first.

On the one hand, when an issue comes in that points out a problem
with a feature so closely related to one or more others it makes
perfect sense to make sure that (and add tests for) the other
related features aren't broken, too. On the other hand, the name
of each regression test clearly indicates which bug it is designed
to exercise and when it should fail for some other reason (e.g.,
a regression in one of the other related macros) it would mislead
one into thinking that there's a problem with MB_LEN_MAX.

I suppose that my view on this is in cases like this, when the
bug report highlights a whole slew of features that aren't being
tested we should add an ordinary (unit) test for the whole area
and, if possible, also a regression test just for the bug. My
rationale for keeping the two separate (even at the cost of
duplicating some tested functionality) is that the bigger unit
test is more likely to be enhanced or tweaked in the future and
thus more likely to be subject to accidentally removing the test
for the bug (or otherwise "regressing"), while the regression
test is much more likely to be left  alone and consequently less
prone to such accidental regressions.

Opinions? Comments? Thoughts?

Martin

Travis Vitek (JIRA) wrote:
>      [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
> 
> Travis Vitek updated STDCXX-436:
> --------------------------------
> 
>     Attachment: 18.limits.stdcxx-436.cpp
> 
> Updated regression test compiles a simple program that simulates getconf and then uses that program to get the values to compare against. The alternative was to just invoke getconv as suggested, but that didn't work on windows, and getconf on some platforms doesn't provide values for all constants [LONG_MIN and LONG_MAX on linux is one example].
> 
>> [Linux] MB_LEN_MAX incorrect
>> ----------------------------
>>
>>                 Key: STDCXX-436
>>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>>             Project: C++ Standard Library
>>          Issue Type: Bug
>>          Components: 18. Language Support
>>    Affects Versions: 4.1.3
>>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>>            Reporter: Mark Brown
>>            Assignee: Travis Vitek
>>            Priority: Critical
>>             Fix For: 4.2
>>
>>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>>
>>
>> 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
> 


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment: 18.limits.stdcxx-436.cpp

Updated regression test compiles a simple program that simulates getconf and then uses that program to get the values to compare against. The alternative was to just invoke getconv as suggested, but that didn't work on windows, and getconf on some platforms doesn't provide values for all constants [LONG_MIN and LONG_MAX on linux is one example].

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12527373 ] 

Travis Vitek commented on STDCXX-436:
-------------------------------------

Doh.

2007-09-13  Travis Vitek <vi...@roguewave.com>

	STDCXX-436
	* LIMITS.cpp: include limits.h to get definition of MB_MAX_LEN
	so that we don't have to guess the correct value. If we must
	guess a default on _WIN32, use a known good value.


> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment: stdcxx-436.patch

2007-09-07  Travis Vitek  <vi...@roguewave.com>

	STDCXX-436
	limits.h (MB_LEN_MAX): redefine MB_LEN_MAX if the current
	value is different from the configured value.
	climits (MB_LEN_MAX): ditto.

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor resolved STDCXX-436.
---------------------------------

    Resolution: Fixed

Thanks. I massaged your Change Log a bit (corrected the typo in MB_LEN_MAX and added the [_WIN32] tag to indicate that the patch applies to _WIN32 only -- see
http://www.gnu.org/prep/standards/html_node/Conditional-Changes.html#Conditional-Changes

Corrected patch committed thus: http://svn.apache.org/viewvc?rev=575978&view=rev

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12526966 ] 

Martin Sebor commented on STDCXX-436:
-------------------------------------

Travis, about the regression test, I was hoping for one that doesn't depend on our own implementation details. I.e., one that fails even when both MB_LEN_MAX and _RWSTD_MB_LEN_MAX are equally wrong. On UNIX, we can do it by invoking the  'getconf MB_LEN_MAX' command within the test and reading its output, like so:

  FILE *f = popen("getconf MB_LEN_MAX");
  int mb_len_max = -1;
  fscanf (f, "%d", &mb_len_max);
  assert (MB_LEN_MAX == mb_len_max);

I'm not sure if this is 100% portable even on UNIX or at all doable on Windows but that shouldn't stop us from implementing it on platforms where the getconf command works reliably.

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (STDCXX-436) [Linux] MB_LEN_MAX incorrect

Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Travis Vitek updated STDCXX-436:
--------------------------------

    Attachment:     (was: 18.limits.stdcxx-436.cpp)

> [Linux] MB_LEN_MAX incorrect
> ----------------------------
>
>                 Key: STDCXX-436
>                 URL: https://issues.apache.org/jira/browse/STDCXX-436
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 18. Language Support
>    Affects Versions: 4.1.3
>         Environment: gcc version 4.1.1 20070105 (Red Hat 4.1.1-51)
>            Reporter: Mark Brown
>            Assignee: Travis Vitek
>            Priority: Critical
>             Fix For: 4.2
>
>         Attachments: 18.limits.stdcxx-436.cpp, LIMITS.cpp.patch, stdcxx-436.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.