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/05/12 17:58:15 UTC

[jira] Created: (STDCXX-411) documented money_get example output doesn't match real output

documented money_get example output doesn't match real output
-------------------------------------------------------------

                 Key: STDCXX-411
                 URL: https://issues.apache.org/jira/browse/STDCXX-411
             Project: C++ Standard Library
          Issue Type: Bug
          Components: Documentation
    Affects Versions: 4.1.3
            Reporter: Mark Brown


-----Original Message-----
From: sebor@roguewave.com
Sent: Fri, 11 May 2007 16:54:37 -0600
To: stdcxx-dev@incubator.apache.org
Subject: Re: money_get example output

Mark Brown wrote:
> Hi all,
> 
> Out of curiosity I tried compiling and running the example from the money_get page with stdcxx on Linux but the output is different than the documentation shows. So I tried it with g++ and the output is different still. Is the documentation incorrect or is there a bug in the library? Can someone explain what the correct output should be?
> 
> $ ./money_get-stdcxx
> $100.02 -->  --> 0e-2175
> $ ./money_get-g++
> $100.02 -->  --> 1.432e-3754
> 
> The example program is on this page: http://incubator.apache.org/stdcxx/doc/stdlibref/money-get.html

I think the problem is that the example code on the documentation
page doesn't set the locale. The real example (i.e., the actual
program) does: it sets it to the English US locale. The code is
here:
http://svn.apache.org/repos/asf/incubator/stdcxx/trunk/examples/manual/moneyget.cpp

The reason why stdcxx and libstdc++ produce different output in
the default "C" locale is in all likelihood because the facet
fails to store a value in the uninitialized variable and the
example ends up writing out bogus bits.

Can you please open a new Documentation issue for this?

FWIW, copying the source code of each example program into the
docs and keeping the two in sync is a maintenance headache. We
should find a better way to do this.

One possibility for dealing with this is to get rid of the code
and replace it with a link to the .cpp file in Subversion. That
alone probably isn't the most user-friendly solution.

A variation on this approach that might be better is to run
a script on the documentation sources after checking them out
of Subversion on the Apache Web server and replace the links
mentioned above with the up-to-date source code of each example
extracted at the same time out of the repository.

Can anyone think of any other ways to keep things in sync, or
of any further improvements to the process?

Martin


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


[jira] Commented: (STDCXX-411) documented money_get example output doesn't match real output

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

Martin Sebor commented on STDCXX-411:
-------------------------------------

See http://mail-archives.apache.org/mod_mbox/incubator-stdcxx-dev/200705.mbox/%3c4644F42D.2000205@roguewave.com%3e

> documented money_get example output doesn't match real output
> -------------------------------------------------------------
>
>                 Key: STDCXX-411
>                 URL: https://issues.apache.org/jira/browse/STDCXX-411
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 4.1.3
>            Reporter: Mark Brown
>         Assigned To: Martin Sebor
>
> -----Original Message-----
> From: sebor@roguewave.com
> Sent: Fri, 11 May 2007 16:54:37 -0600
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: money_get example output
> Mark Brown wrote:
> > Hi all,
> > 
> > Out of curiosity I tried compiling and running the example from the money_get page with stdcxx on Linux but the output is different than the documentation shows. So I tried it with g++ and the output is different still. Is the documentation incorrect or is there a bug in the library? Can someone explain what the correct output should be?
> > 
> > $ ./money_get-stdcxx
> > $100.02 -->  --> 0e-2175
> > $ ./money_get-g++
> > $100.02 -->  --> 1.432e-3754
> > 
> > The example program is on this page: http://incubator.apache.org/stdcxx/doc/stdlibref/money-get.html
> I think the problem is that the example code on the documentation
> page doesn't set the locale. The real example (i.e., the actual
> program) does: it sets it to the English US locale. The code is
> here:
> http://svn.apache.org/repos/asf/incubator/stdcxx/trunk/examples/manual/moneyget.cpp
> The reason why stdcxx and libstdc++ produce different output in
> the default "C" locale is in all likelihood because the facet
> fails to store a value in the uninitialized variable and the
> example ends up writing out bogus bits.
> Can you please open a new Documentation issue for this?
> FWIW, copying the source code of each example program into the
> docs and keeping the two in sync is a maintenance headache. We
> should find a better way to do this.
> One possibility for dealing with this is to get rid of the code
> and replace it with a link to the .cpp file in Subversion. That
> alone probably isn't the most user-friendly solution.
> A variation on this approach that might be better is to run
> a script on the documentation sources after checking them out
> of Subversion on the Apache Web server and replace the links
> mentioned above with the up-to-date source code of each example
> extracted at the same time out of the repository.
> Can anyone think of any other ways to keep things in sync, or
> of any further improvements to the process?
> Martin

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


[jira] Resolved: (STDCXX-411) documented money_get example output doesn't match real output

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

Martin Sebor resolved STDCXX-411.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 4.2

The HTML page now matches the example program (except for some insignificant details).

> documented money_get example output doesn't match real output
> -------------------------------------------------------------
>
>                 Key: STDCXX-411
>                 URL: https://issues.apache.org/jira/browse/STDCXX-411
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 4.1.3
>            Reporter: Mark Brown
>         Assigned To: Martin Sebor
>             Fix For: 4.2
>
>
> -----Original Message-----
> From: sebor@roguewave.com
> Sent: Fri, 11 May 2007 16:54:37 -0600
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: money_get example output
> Mark Brown wrote:
> > Hi all,
> > 
> > Out of curiosity I tried compiling and running the example from the money_get page with stdcxx on Linux but the output is different than the documentation shows. So I tried it with g++ and the output is different still. Is the documentation incorrect or is there a bug in the library? Can someone explain what the correct output should be?
> > 
> > $ ./money_get-stdcxx
> > $100.02 -->  --> 0e-2175
> > $ ./money_get-g++
> > $100.02 -->  --> 1.432e-3754
> > 
> > The example program is on this page: http://incubator.apache.org/stdcxx/doc/stdlibref/money-get.html
> I think the problem is that the example code on the documentation
> page doesn't set the locale. The real example (i.e., the actual
> program) does: it sets it to the English US locale. The code is
> here:
> http://svn.apache.org/repos/asf/incubator/stdcxx/trunk/examples/manual/moneyget.cpp
> The reason why stdcxx and libstdc++ produce different output in
> the default "C" locale is in all likelihood because the facet
> fails to store a value in the uninitialized variable and the
> example ends up writing out bogus bits.
> Can you please open a new Documentation issue for this?
> FWIW, copying the source code of each example program into the
> docs and keeping the two in sync is a maintenance headache. We
> should find a better way to do this.
> One possibility for dealing with this is to get rid of the code
> and replace it with a link to the .cpp file in Subversion. That
> alone probably isn't the most user-friendly solution.
> A variation on this approach that might be better is to run
> a script on the documentation sources after checking them out
> of Subversion on the Apache Web server and replace the links
> mentioned above with the up-to-date source code of each example
> extracted at the same time out of the repository.
> Can anyone think of any other ways to keep things in sync, or
> of any further improvements to the process?
> Martin

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


[jira] Assigned: (STDCXX-411) documented money_get example output doesn't match real output

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

Martin Sebor reassigned STDCXX-411:
-----------------------------------

    Assignee: Martin Sebor

> documented money_get example output doesn't match real output
> -------------------------------------------------------------
>
>                 Key: STDCXX-411
>                 URL: https://issues.apache.org/jira/browse/STDCXX-411
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 4.1.3
>            Reporter: Mark Brown
>         Assigned To: Martin Sebor
>
> -----Original Message-----
> From: sebor@roguewave.com
> Sent: Fri, 11 May 2007 16:54:37 -0600
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: money_get example output
> Mark Brown wrote:
> > Hi all,
> > 
> > Out of curiosity I tried compiling and running the example from the money_get page with stdcxx on Linux but the output is different than the documentation shows. So I tried it with g++ and the output is different still. Is the documentation incorrect or is there a bug in the library? Can someone explain what the correct output should be?
> > 
> > $ ./money_get-stdcxx
> > $100.02 -->  --> 0e-2175
> > $ ./money_get-g++
> > $100.02 -->  --> 1.432e-3754
> > 
> > The example program is on this page: http://incubator.apache.org/stdcxx/doc/stdlibref/money-get.html
> I think the problem is that the example code on the documentation
> page doesn't set the locale. The real example (i.e., the actual
> program) does: it sets it to the English US locale. The code is
> here:
> http://svn.apache.org/repos/asf/incubator/stdcxx/trunk/examples/manual/moneyget.cpp
> The reason why stdcxx and libstdc++ produce different output in
> the default "C" locale is in all likelihood because the facet
> fails to store a value in the uninitialized variable and the
> example ends up writing out bogus bits.
> Can you please open a new Documentation issue for this?
> FWIW, copying the source code of each example program into the
> docs and keeping the two in sync is a maintenance headache. We
> should find a better way to do this.
> One possibility for dealing with this is to get rid of the code
> and replace it with a link to the .cpp file in Subversion. That
> alone probably isn't the most user-friendly solution.
> A variation on this approach that might be better is to run
> a script on the documentation sources after checking them out
> of Subversion on the Apache Web server and replace the links
> mentioned above with the up-to-date source code of each example
> extracted at the same time out of the repository.
> Can anyone think of any other ways to keep things in sync, or
> of any further improvements to the process?
> Martin

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