Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000892 [1003.1(2013)/Issue7+TC1] System Interfaces Editorial Omission 2014-11-13 23:53 2015-02-19 18:03
Reporter safinaskar View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Resolved  
Name Askar Safin
Organization
User Reference
Section atol, atoll
Page Number posix 2008, 2013 edition, page 618
Line Number 21127 - 21129
Interp Status ---
Final Accepted Text Note: 0002548
Summary 0000892: You forget atoll
Description -The atol( ) function is subsumed by strtol( ) but is retained because it is used extensively in
-existing code. If the number is not known to be in range, strtol( ) should be used because atol( ) is
-not required to perform any error checking.
+The atol( ) function is subsumed by strtol( ) (and atoll( ) by strtoll( )) but is retained because it is used extensively in
+existing code. If the number is not known to be in range, strtol( ) (strtoll( )) should be used because atol( ) (atoll( )) is
+not required to perform any error checking.

Also, I think it is good idea to merge atof, atoi, atol and atoll articles to one article.

Also, I don't see why atoll argument is named nptr (unlike atol argument), so, I think it should be renamed to str.
Desired Action Fix...
Tags tc2-2008
Attached Files

- Relationships

-  Notes
(0002548)
geoffclare (manager)
2015-02-19 17:21

On page 618 line 21108 section atol(), change:
<tt>long atol(const char *str);</tt>
to:
<tt>long atol(const char *nptr);</tt>


On page 618 line 21114 section atol(), change:
The call atol(str) shall be equivalent to:
<tt>strtol(str, (char **)NULL, 10)</tt>
to:
Except as noted below, the call atol(nptr) shall be equivalent to:
<tt>strtol(nptr, (char **)NULL, 10)</tt>


On page 618 line 21116 section atol(), change:
The call to atoll(nptr) shall be equivalent to:
to:
Except as noted below, the call to atoll(nptr) shall be equivalent to:


On page 618 line 21118 section atol(), change:
except that the handling of errors may differ.
to:
The handling of errors may differ.


On page 618 line 21127 section atol(), change:
The atol( ) function is subsumed by strtol() but is retained because it is used extensively in existing code. If the number is not known to be in range, strtol() should be used because atol() is not required to perform any error checking.
to:
If the number is not known to be in range, strtol() or strtoll() should be used because atol() and atoll() are not required to perform any error checking.


On page 2059 line 65800 section strtol(), change:
<tt>long strtol(const char *restrict str, char **restrict endptr, int base);
    long long strtoll(const char *restrict str, char **restrict endptr,
    int base)</tt>
to:
<tt>long strtol(const char *restrict nptr, char **restrict endptr, int base);
    long long strtoll(const char *restrict nptr, char **restrict endptr,
    int base)</tt>


On page 2059 line 65807 section strtol(), change:
These functions shall convert the initial portion of the string pointed to by str
to:
These functions shall convert the initial portion of the string pointed to by nptr


On page 2060 line 65841 section strtol(), change:
the value of str shall be stored
to:
the value of nptr shall be stored
(0002549)
eblake (manager)
2015-02-19 18:03

The suggestion for merging atoi with atol/atoll is worthwhile, but belongs in a separate bug targetted at Issue 8. The suggestion for merging atof was turned down, as atof/strtod is not the same as atoi/strtol (the str counterparts have different numbers of parameters, and floating point is different from integer math for having to think about things like NaN).

- Issue History
Date Modified Username Field Change
2014-11-13 23:53 safinaskar New Issue
2014-11-13 23:53 safinaskar Name => Askar Safin
2014-11-13 23:53 safinaskar Section => atol, atoll
2014-11-13 23:53 safinaskar Page Number => posix 2008, 2013 edition, page 618
2014-11-13 23:53 safinaskar Line Number => 21127 - 21129
2015-02-19 17:21 geoffclare Note Added: 0002548
2015-02-19 17:23 geoffclare Interp Status => ---
2015-02-19 17:23 geoffclare Final Accepted Text => Note: 0002548
2015-02-19 17:23 geoffclare Status New => Resolved
2015-02-19 17:23 geoffclare Resolution Open => Accepted As Marked
2015-02-19 17:24 geoffclare Tag Attached: tc2-2008
2015-02-19 18:03 eblake Note Added: 0002549


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker