[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2020-04-23 Thread Austin Group Bug Tracker


The following issue has a resolution that has been APPLIED. 
== 
https://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Applied
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:https://austingroupbugs.net/view.php?id=1108#c4094 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2020-04-23 11:16 UTC
== 
Summary:LONG_MIN must be <= -2147483648
==
Relationships   ID  Summary
--
parent of   0001197 Omission from 1108: LONG_MIN must be &l...
has duplicate   0001177 Misstated permitted limits on signed types
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
https://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
2018-07-12 11:43 shware_systems Note Added: 0004052  
2018-07-30 19:02 eblake Note Added: 0004064  
2018-07-30 20:29 eblake Relationship added   parent of 0001197   
2018-08-23 16:32 eblake Resolution   Accepted As Marked =>
Reopened
2018-08-24 08:29 geoffclare Note Added: 0004089  
2018-08-24 08:30 geoffclare Note Edited: 0004089 
2018-08-24 12:54 kreNote Added: 0004090  
2018-08-30 15:27 eblake Note Added: 0004094  
2018-08-30 15:40 eblake Note Edited: 0004094 
2018-08-30 15:42 eblake Note Edited: 0004094 
2018-08-30 15:43 eblake Note Edited: 0004094 
2018-08-30 15:44 eblake Note Edited: 0004094 
2018-08-30 15:45 eblake Note Edited: 0004094 
2018-08-30 15:49 eblake Final Accepted Text 
https://austingroupbugs.net/view.php?id=1108#c4041 =>
https://austingroupbugs.net/view.php?id=1108#c4094
2018-08-30 15:49 eblake Resolution   Reopened => Accepted As
Marked
2019-02-14 17:03 eblake Relationship added   related to 0001177  
2019-02-14 17:07 Don Cragun Relationship replacedhas duplicate 0001177
2020-04-23 11:16 geoffclare Status   Resolved => Applied 
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2019-02-14 Thread Austin Group Bug Tracker


The issue 0001177 has been set as DUPLICATE OF the following issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4094 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-08-30 15:49 UTC
== 
Summary:LONG_MIN must be <= -2147483648
==
Relationships   ID  Summary
--
parent of   0001197 Omission from 1108: LONG_MIN must be &l...
has duplicate   0001177 Misstated permitted limits on signed types
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
2018-07-12 11:43 shware_systems Note Added: 0004052  
2018-07-30 19:02 eblake Note Added: 0004064  
2018-07-30 20:29 eblake Relationship added   parent of 0001197   
2018-08-23 16:32 eblake Resolution   Accepted As Marked =>
Reopened
2018-08-24 08:29 geoffclare Note Added: 0004089  
2018-08-24 08:30 geoffclare Note Edited: 0004089 
2018-08-24 12:54 kreNote Added: 0004090  
2018-08-30 15:27 eblake Note Added: 0004094  
2018-08-30 15:40 eblake Note Edited: 0004094 
2018-08-30 15:42 eblake Note Edited: 0004094 
2018-08-30 15:43 eblake Note Edited: 0004094 
2018-08-30 15:44 eblake Note Edited: 0004094 
2018-08-30 15:45 eblake Note Edited: 0004094 
2018-08-30 15:49 eblake Final Accepted Text 
http://austingroupbugs.net/view.php?id=1108#c4041 =>
http://austingroupbugs.net/view.php?id=1108#c4094
2018-08-30 15:49 eblake Resolution   Reopened => Accepted As
Marked
2019-02-14 17:03 eblake Relationship added   related to 0001177  
2019-02-14 17:07 Don Cragun Relationship replacedhas duplicate 0001177
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2019-02-14 Thread Austin Group Bug Tracker


The following issue has been set as RELATED TO issue 0001177. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4094 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-08-30 15:49 UTC
== 
Summary:LONG_MIN must be <= -2147483648
==
Relationships   ID  Summary
--
parent of   0001197 Omission from 1108: LONG_MIN must be &l...
related to  0001177 Misstated permitted limits on signed types
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
2018-07-12 11:43 shware_systems Note Added: 0004052  
2018-07-30 19:02 eblake Note Added: 0004064  
2018-07-30 20:29 eblake Relationship added   parent of 0001197   
2018-08-23 16:32 eblake Resolution   Accepted As Marked =>
Reopened
2018-08-24 08:29 geoffclare Note Added: 0004089  
2018-08-24 08:30 geoffclare Note Edited: 0004089 
2018-08-24 12:54 kreNote Added: 0004090  
2018-08-30 15:27 eblake Note Added: 0004094  
2018-08-30 15:40 eblake Note Edited: 0004094 
2018-08-30 15:42 eblake Note Edited: 0004094 
2018-08-30 15:43 eblake Note Edited: 0004094 
2018-08-30 15:44 eblake Note Edited: 0004094 
2018-08-30 15:45 eblake Note Edited: 0004094 
2018-08-30 15:49 eblake Final Accepted Text 
http://austingroupbugs.net/view.php?id=1108#c4041 =>
http://austingroupbugs.net/view.php?id=1108#c4094
2018-08-30 15:49 eblake Resolution   Reopened => Accepted As
Marked
2019-02-14 17:03 eblake Relationship added   related to 0001177  
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-08-30 Thread Austin Group Bug Tracker


The following issue has been UPDATED. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4094 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-08-30 15:49 UTC
== 
Summary:LONG_MIN must be <= -2147483648
==
Relationships   ID  Summary
--
parent of   0001197 Omission from 1108: LONG_MIN must be &l...
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
2018-07-12 11:43 shware_systems Note Added: 0004052  
2018-07-30 19:02 eblake Note Added: 0004064  
2018-07-30 20:29 eblake Relationship added   parent of 0001197   
2018-08-23 16:32 eblake Resolution   Accepted As Marked =>
Reopened
2018-08-24 08:29 geoffclare Note Added: 0004089  
2018-08-24 08:30 geoffclare Note Edited: 0004089 
2018-08-24 12:54 kreNote Added: 0004090  
2018-08-30 15:27 eblake Note Added: 0004094  
2018-08-30 15:40 eblake Note Edited: 0004094 
2018-08-30 15:42 eblake Note Edited: 0004094 
2018-08-30 15:43 eblake Note Edited: 0004094 
2018-08-30 15:44 eblake Note Edited: 0004094 
2018-08-30 15:45 eblake Note Edited: 0004094 
2018-08-30 15:49 eblake Final Accepted Text 
http://austingroupbugs.net/view.php?id=1108#c4041 =>
http://austingroupbugs.net/view.php?id=1108#c4094
2018-08-30 15:49 eblake Resolution   Reopened => Accepted As
Marked
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-08-30 Thread Austin Group Bug Tracker


A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Reopened
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-08-30 15:27 UTC
== 
Summary:LONG_MIN must be <= -2147483648
==
Relationships   ID  Summary
--
parent of   0001197 Omission from 1108: LONG_MIN must be &l...
== 

-- 
 (0004094) eblake (manager) - 2018-08-30 15:27
 http://austingroupbugs.net/view.php?id=1108#c4094 
-- 
On P280 L9437 replaceMaximum Acceptable Value: −2 147 483
647withMaximum Acceptable Value: −2 147
483 648
At Line 9443 replaceMaximum Acceptable Value: −9 223 372 036
854 775 807withMaximum Acceptable Value: −9
223 372 036 854 775 808
At L9452 replaceMaximum Acceptable Value: −2 147 483
647withMaximum Acceptable Value: −2 147 483
648
At L9467 replaceMaximum Acceptable Value: −32
767withMaximum Acceptable Value: −32
768
After P282 L9539 () add a new paragraph:The maximum
values for SCHAR_MIN, SHRT_MIN, LONG_MIN and LLONG_MIN differ from the C
Standard because POSIX.1 requires two's complement representation for the
corresponding integer types. The maximum value for INT_MIN differs both for
that reason and because POSIX.1 requires that int has a width of at
least 32 bits. See also the RATIONALE section for .
On P282 L9543 () add  to the SEE ALSO section.

On P348 L11817 () change:An N-bit signed type has
values in the range -2N-1 or 1-2N-1 to
2N-1-1, while an N-bit unsigned type has values in the range 0
to 2N-1withAn N-bit signed type in
two's complement representation has values in the range -2N-1 to
2N-1-1, while an N-bit unsigned type has values in the range 0
to 2N-1.
While the C standard also permits signed integers in sign-magnitude or
one's complement form, this standard requires an implementation to use
two's complement representation for the standard integer types.

After P349 L11866 add a new paragraph with CX shading:If the
representation of any of the standard types short, int,
long or long long is not the same as one of the above
required types, an intN_t type with that
representation shall be defined along with its uintN_t
counterpart.
On P351-352 L11944-11965 () change all occurrences
of:-1)to:)and add CX
shading to the affected text in parentheses.

On P352 L11979 (), change:-65
535to:-65 536
On P354 L12040 (), replace
(The POSIX standard explicitly requires 8-bit char and
two's-complement arithmetic.)withSince the POSIX.1
standard explicitly requires 8-bit char with two's complement arithmetic,
it is easier for application writers if the same two's complement
guarantees are extended to all of the other standard integer types. 
Furthermore, in programming environments with a 32-bit long, some
POSIX.1 interfaces, such as mrand48(), cannot be implemented if
long does not use a two's complement representation.
On P567 L19838 (abs), replaceIn two's-complement
representation, the absolute value of the negative integer with largest
magnitude {INT_MIN} might not be
representable.withSince POSIX.1 requires a two's
complement representation of int, the absolute value of the negative
integer with the largest magnitude {INT_MIN} is not representable, thus
abs(INT_MIN) is undefined.
On P1135 L38361 (imaxabs), replaceThe absolute value of the
most negative number cannot be represented in two's
complement.withSince POSIX.1 requires a two's
complement representation of intmax_t, the absolute value of the
negative integer with the largest magnitude {INTMAX_MIN} is not
representable, thus imaxabs(INTMAX_MIN) is undefined.
On P1232 L41195 (lab

[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-08-24 Thread Austin Group Bug Tracker


A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Reopened
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-08-24 12:54 UTC
== 
Summary:LONG_MIN must be <= -2147483648
==
Relationships   ID  Summary
--
parent of   0001197 Omission from 1108: LONG_MIN must be &l...
== 

-- 
 (0004090) kre (reporter) - 2018-08-24 12:54
 http://austingroupbugs.net/view.php?id=1108#c4090 
-- 
Re note 4089

If the standard changes as mentioned, the pre-call check can still be
done if desired (which makes the code C standard conformant) but if
POSIX compliance is all that is needed, then a post-call check can be

xmag = abs(x);
if (xmag < 0)
{
/* special handling */
}

which turns out to work (on a 2's complement system, ie: anything
POSIX conformant) when abs is a function, or when it is a macro...

#define abs(x)   ((x) < 0 ? -(x) : (x))

(and yes, I know that would evaluate its operand twice - the advantage
of the macro is that it is data type agnostic, it works for int, long,
ssize_t, intmax_t, float, double, long double ...)

I don't usually comment on issues like this one, but FWIW, I support the
change - it is perfectly reasonable for any particular implementation to
define what happens for its implementation when a standard says that
something is undefined.   That means it is perfectly reasonable for all
implementations, which are POSIX conformant, to define arithmetic as being
what 2's complement produces (without traps for integers, other than
divide by 0) and then if all implementations implement it that way, it
is perfectly reasonable for the POSIX standard to say that is what
happens,
so users can rely on it in a more portable way than "just my
implementation".

This makes zero difference to anyone writing C standards conformant code,
as if there is any chance that xxx_MIN will be involved in any arithmetic
which could cause undefined C behaviour, the code needs to check before
doing the operation.   Hence such code will never do abs(INT_MIN) and what
POSIX says will happen in such a case is irrelevant.

That compiler writers prefer as much to be undefined as possible, so they
can do whatever they like, instead of what is reasonable, doesn't bother
me
at all.   Let them deal with it. 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare

[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-08-24 Thread Austin Group Bug Tracker


A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Reopened
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-08-24 08:29 UTC
== 
Summary:LONG_MIN must be <= -2147483648
==
Relationships   ID  Summary
--
parent of   0001197 Omission from 1108: LONG_MIN must be &l...
== 

-- 
 (0004089) geoffclare (manager) - 2018-08-24 08:29
 http://austingroupbugs.net/view.php?id=1108#c4089 
-- 
A thought about the abs() changes...

I don't see that anybody gains anything from these changes.  Currently with
abs(INT_MIN) undefined, applications which call abs(x) for arbitrary
integer x must do a pre-call check something like this:
if (x == INT_MIN)
{
   /* special handling ... */
}
else
{
xmag = abs(x);
}
If the standard changes to require that abs(INT_MIN) returns INT_MIN,
this would mean the code could instead do a post-call check something
like:
xmag = abs(x);
if (xmag == INT_MIN)
{
   /* special handling ... */
}

but this has no advantage over the pre-call check; in fact the pre-call
check is arguably better because it saves a function call.

When we specify behaviour where the C standard says it is undefined, we
need a good reason to do so.  I see no sufficiently good reason here, and
the fact that the change would make some implementations non-conforming is
a reason not to make the change. 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
2018-07-12 11:43 shware_systems Note Added: 0004052  
2018-07-30 19:02 eblake Note Added: 0004064  
2018-07-30 20:29 eblake Relationship added   parent of 0001197   
2018-08-23 16:32 eblake Resolution   Accepted As Marked =>
Reopened
2018-08-24 08:29 geoffclare Note Added: 0004089  
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-08-23 Thread Austin Group Bug Tracker


The following issue has been UPDATED. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Reopened
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-08-23 16:32 UTC
== 
Summary:LONG_MIN must be <= -2147483648
==
Relationships   ID  Summary
--
parent of   0001197 Omission from 1108: LONG_MIN must be &l...
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
2018-07-12 11:43 shware_systems Note Added: 0004052  
2018-07-30 19:02 eblake Note Added: 0004064  
2018-07-30 20:29 eblake Relationship added   parent of 0001197   
2018-08-23 16:32 eblake Resolution   Accepted As Marked =>
Reopened
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-07-30 Thread Austin Group Bug Tracker


The following issue has been set PARENT OF issue 0001197. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-07-30 19:02 UTC
== 
Summary:LONG_MIN must be <= -2147483648
==
Relationships   ID  Summary
--
parent of   0001197 Omission from 1108: LONG_MIN must be &l...
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
2018-07-12 11:43 shware_systems Note Added: 0004052  
2018-07-30 19:02 eblake Note Added: 0004064  
2018-07-30 20:29 eblake Relationship added   parent of 0001197   
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-07-30 Thread Austin Group Bug Tracker


A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-07-30 19:02 UTC
== 
Summary:LONG_MIN must be <= -2147483648
== 

-- 
 (0004064) eblake (manager) - 2018-07-30 19:02
 http://austingroupbugs.net/view.php?id=1108#c4064 
-- 
Mailing list traffic has complained about making abs(x) and friends
well-defined for all x, on the grounds that it needlessly hurts compiler
optimizations.  For example, some compilers offer options such as -ftrapv
vs. -fwrapv that can fine-tune whether abs(INT_MIN) behaves a specific way,
whereas POSIX unilaterally requiring a specific behavior is at odds with
that ability to fine-tune behavior.

Thus, this is a valid argument worth reopening the discussion on this bug,
and limiting the changes to JUST making int and friends have
twos-complement representation, without also requiring (as a much tighter
restriction than C) that abs(INT_MIN) be well-defined. 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
2018-07-12 11:43 shware_systems Note Added: 0004052  
2018-07-30 19:02 eblake Note Added: 0004064  
==




Re: [1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-07-18 Thread Joseph Myers
On Wed, 11 Jul 2018, Vincent Lefevre wrote:

> I completely disagree on this change. Undefined behavior is useful

Likewise.  That part of the changes is clearly a bad idea and should not 
be applied to issue 8.

-- 
Joseph S. Myers
jos...@codesourcery.com



[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-07-12 Thread Austin Group Bug Tracker


A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-07-12 11:43 UTC
== 
Summary:LONG_MIN must be <= -2147483648
== 

-- 
 (0004052) shware_systems (reporter) - 2018-07-12 11:43
 http://austingroupbugs.net/view.php?id=1108#c4052 
-- 
Re: 4050: 
Those compilers are presuming it is required that -2^N is a trap
representation on all platforms, and are therefore only suitable for a
subset of C conforming platforms, as this is a reliance on undefined
behavior, from POSIX perspective. It only guarantees the behavior within
the limits *_MIN to *_MAX, not defines anything for values outside what has
been specified. The C standard leaves it implementation-defined, and to
clarify that ambiguity POSIX is, with this bug note, making it explicit
it's a non-trap value for a given bit-width to be aligned with the majority
of existing practice and other parts of the standards that require this.

This change does not really preclude those types of compilers, either, that
I see. A platform can have additional compilation environments that
document that this is what has been chosen as the C conforming behavior.
This change just affects the standard POSIX environments getconf is
required to report about and when _POSIX_C_SOURCE is defined. It was also
brought up that there could possibly be more compilation environments
defined, for trap and non-trap variants of 1s-complement and
sign-magnitude, but since only one known processor family makes use of
1s-complement in hardware, and none sign-magnitude or 2s-complement with
trap, this was not considered a priority. 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
2018-07-12 11:43 shware_systems Note Added: 0004052  
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-07-12 Thread Austin Group Bug Tracker


A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-07-12 08:13 UTC
== 
Summary:LONG_MIN must be <= -2147483648
== 

-- 
 (0004051) geoffclare (manager) - 2018-07-12 08:13
 http://austingroupbugs.net/view.php?id=1108#c4051 
-- 
Re: http://austingroupbugs.net/view.php?id=1108#c4050 (last sentence), the range
is specified as [-2^31,2^31)
where the opening bracket is square indicating that the -2^31 is included
while the closing bracket is round indicating that the 2^31 is not included
in the range. 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
2018-07-12 08:13 geoffclare Note Added: 0004051  
==




Re: [1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-07-12 Thread Vincent Lefevre
On 2018-07-11 21:10:16 +, Austin Group Bug Tracker wrote:
>  (0004050) cmsmith (reporter) - 2018-07-11 21:10
>  http://austingroupbugs.net/view.php?id=1108#c4050 
> -- 
> These changes seem to invalidate compilers for use in Unix/POSIX which use
> trap representations for int, long, etc., variables.  I may be missing

Not trap representations (this is unrelated), but the fact that
compilers regard undefined behavior as having any effect, which
can be used for optimization. This is common nowadays.

BTW, I can't comment on this bug: I get an error
"The action cannot be performed because issue "1108" is read-only."

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-07-11 Thread Austin Group Bug Tracker


A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-07-11 21:10 UTC
== 
Summary:LONG_MIN must be <= -2147483648
== 

-- 
 (0004050) cmsmith (reporter) - 2018-07-11 21:10
 http://austingroupbugs.net/view.php?id=1108#c4050 
-- 
These changes seem to invalidate compilers for use in Unix/POSIX which use
trap representations for int, long, etc., variables.  I may be missing
something, but, at least in the 2016 specification, I didn't see anything
that precluded that.  I know POSIX uses int8_t, int16_t, int32_t, etc., but
those can be implemented using other data types (perhaps of the same size
of int or long) but don't have the ability to store invalid values.  I am
not sure when mrand48() and jrand48() changed form the 2016 spec that lists
the range as being from -2^31 to +2^31. 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
2018-06-07 16:11 geoffclare Tag Attached: issue8 
2018-07-11 21:10 cmsmithNote Added: 0004050  
==




Re: [1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-07-11 Thread Vincent Lefevre
On 2018-06-07 16:10:03 +, Austin Group Bug Tracker wrote:
> On P567 L19829 (abs), replaceIf the result cannot be
> represented, the behavior is undefined.withIf
> the result cannot be represented, the result shall be
> {INT_MIN}.
> On P567 L19838 (abs), replaceIn two's-complement
> representation, the absolute value of the negative integer with largest
> magnitude {INT_MIN} might not be
> representable.withSince POSIX.1 requires a
> two's complement representation of int, the absolute value of the
> negative integer with the largest magnitude {INT_MIN} is not representable;
> but the rules of negation in two's complement arithmetic ensure that
> {INT_MIN} is returned.

I completely disagree on this change. Undefined behavior is useful
in order to allow the compiler to optimize, e.g. the compiler should
be allowed to assume that abs(x) >= 0 during VRP. This is also
useful for security: undefined behavior allows the compiler to check
this particular case and trigger a trap, avoiding erratic behavior
of the program.

Ditto for the other similar changes:

> On P1135 L38352 (imaxabs), replaceIf the result cannot be
> represented, the behavior is undefined.withIf
> the result cannot be represented, the result shall be
> {INTMAX_MIN}.
> On P1135 L38361 (imaxabs), replaceThe absolute value of the
> most negative number cannot be represented in two's
> complement.withSince POSIX.1 requires a two's
> complement representation of intmax_t, the absolute value of the
> negative integer with the largest magnitude {INTMAX_MIN} is not
> representable; but the rules of negation in two's complement arithmetic
> ensure that {INTMAX_MIN} is returned.
>  On P1232 L41185 (labs), replaceIf the result cannot be
> represented, the behavior is undefined.withIf
> the result cannot be represented, the result shall be {LONG_MIN} for
> labs() or {LLONG_MIN} for llabs() .
> On P1232 L41195 (labs APPLICATION USAGE),
> replaceNone.withSince POSIX.1
> requires a two's complement representation of long and long
> long, the absolute value of the negative integer with the largest
> magnitude {LONG_MIN} or {LLONG_MIN} is not representable; but the rules of
> negation in two's complement arithmetic ensure that {LONG_MIN} (for
> labs()) or {LLONG_MIN} (for llabs()) is
> returned.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-06-07 Thread Austin Group Bug Tracker


The following issue has been RESOLVED. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: Resolved
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text:http://austingroupbugs.net/view.php?id=1108#c4041 
Resolution: Accepted As Marked
Fixed in Version:   
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-06-07 16:11 UTC
== 
Summary:LONG_MIN must be <= -2147483648
== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
2018-06-07 16:10 geoffclare Note Added: 0004041  
2018-06-07 16:11 geoffclare Interp Status => --- 
2018-06-07 16:11 geoffclare Final Accepted Text   =>
http://austingroupbugs.net/view.php?id=1108#c4041
2018-06-07 16:11 geoffclare Status   New => Resolved 
2018-06-07 16:11 geoffclare Resolution   Open => Accepted As
Marked
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2018-06-07 Thread Austin Group Bug Tracker


A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: New
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text: 
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2018-06-07 16:10 UTC
== 
Summary:LONG_MIN must be <= -2147483648
== 

-- 
 (0004041) geoffclare (manager) - 2018-06-07 16:10
 http://austingroupbugs.net/view.php?id=1108#c4041 
-- 
On P280 L9437 replaceMaximum Acceptable Value: −2 147 483
647withMaximum Acceptable Value: −2 147
483 648
At Line 9443 replaceMaximum Acceptable Value: −9 223 372 036
854 775 807withMaximum Acceptable Value: −9
223 372 036 854 775 808
At L9452 replaceMaximum Acceptable Value: −2 147 483
647withMaximum Acceptable Value: −2 147 483
648
At L9467 replaceMaximum Acceptable Value: −32
767withMaximum Acceptable Value: −32
768
After P282 L9539 () add a new paragraph:The maximum
values for SCHAR_MIN, SHRT_MIN, LONG_MIN and LLONG_MIN differ from the C
Standard because POSIX.1 requires two's complement representation for the
corresponding integer types. The maximum value for INT_MIN differs both for
that reason and because POSIX.1 requires that int has a width of at
least 32 bits. See also the RATIONALE section for .
On P282 L9543 () add  to the SEE ALSO section.

On P348 L11817 () change:An N-bit signed type has
values in the range -2N-1 or 1-2N-1 to
2N-1-1, while an N-bit unsigned type has values in the range 0
to 2N-1withAn N-bit signed type in
two's complement representation has values in the range -2N-1 to
2N-1-1, while an N-bit unsigned type has values in the range 0
to 2N-1.
While the C standard also permits signed integers in sign-magnitude or
one's complement form, this standard requires an implementation to use
two's complement representation for the standard integer types.

After P349 L11866 add a new paragraph with CX shading:If the
representation of any of the standard types short, int,
long or long long is not the same as one of the above
required types, an intN_t type with that
representation shall be defined along with its uintN_t
counterpart.
On P351-352 L11944-11965 () change all occurrences
of:-1)to:)and add CX
shading to the affected text in parentheses.

On P352 L11979 (), change:-65
535to:-65 536
On P354 L12040 (), replace
(The POSIX standard explicitly requires 8-bit char and
two's-complement arithmetic.)withSince the POSIX.1
standard explicitly requires 8-bit char with two's complement arithmetic,
it is easier for application writers if the same two's complement
guarantees are extended to all of the other standard integer types. 
Furthermore, in programming environments with a 32-bit long, some
POSIX.1 interfaces, such as mrand48(), cannot be implemented if
long does not use a two's complement representation.
On P567 L19829 (abs), replaceIf the result cannot be
represented, the behavior is undefined.withIf
the result cannot be represented, the result shall be
{INT_MIN}.
On P567 L19838 (abs), replaceIn two's-complement
representation, the absolute value of the negative integer with largest
magnitude {INT_MIN} might not be
representable.withSince POSIX.1 requires a
two's complement representation of int, the absolute value of the
negative integer with the largest magnitude {INT_MIN} is not representable;
but the rules of negation in two's complement arithmetic ensure that
{INT_MIN} is returned.
On P1135 L38352 (imaxabs), replaceIf the result cannot be
represented, the behavior is undefined.withIf
the result cannot be represented, the result shall be
{INTMAX_MIN}.
On P1135 L38361 (imaxabs), replaceThe absolute value of the
most negative number cannot be represented in two's
complement.withSince POSIX.1 requires a two's
complement representation of intmax_t, the absolute value of the
negative integer with the largest magnitude {INTMAX_MIN} is not
representable; but the rules of negation in

[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2016-12-09 Thread Austin Group Bug Tracker

A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: New
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text: 
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2016-12-09 22:25 UTC
== 
Summary:LONG_MIN must be <= -2147483648
== 

-- 
 (0003513) nsz (reporter) - 2016-12-09 22:25
 http://austingroupbugs.net/view.php?id=1108#c3513 
-- 
i think it's not reasonable to change function types now:

that can break abi so the symbol name has to change then too.
it can break a lot of source code as well because of the
incompatible type (which would depend on _XOPEN_SOURCE
macro definition).

if these apis were useful then a new variant of them could
be introduced under a new name, but i think it's better to
obsolete them instead. 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
2016-12-09 22:25 nszNote Added: 0003513  
==




Re: [1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2016-12-09 Thread SHwareSyst
The appropriate change imo is changing the numeric references in  jrand48() 
and mrand48() to the 
symbolic range LONG_MIN to LONG_MAX, not change LONG_MIN. POSIX  inherits 
the range of 
long from the C standard, and that also is -2147483647 for  LONG_MIN there, 
in Clause 5.2.4.2.1. 
The description has a typo therefore, '[' should be '(', but the symbolic  
names make it even clearer. 
Only SCHAR_MIN == -(SCHAR_MAX+1), as a CX range  override; the other 
integers follow that 
clause and are SIGNED_MIN == -SIGNED_MAX. The   description may 
need a clause 
saying LONG_MIN and LONG_MAX shall be made visible from ,  as a 
specific reason for 
having it in the allowed #include list.
 
At C165 Line 25522, Change:
   over the interval [-2^31, 2^31).
to:
   over the interval [LONG_MIN, LONG_MAX].
or:
   over the interval (-2^31, 2^31).
 
 
In a message dated 12/9/2016 12:23:32 P.M. Eastern Standard Time,  
nore...@msnkbrown.net writes:


The  following issue has been SUBMITTED.  
==  
http://austingroupbugs.net/view.php?id=1108  
==  
Reported By: nsz
Assigned To: 
==  
Project:   1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category: Base Definitions and  Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status:  New
Name:   Szabolcs Nagy 
Organization: musl libc 
User Reference:   
Section:   limits.h 
Page Number: 
Line Number: 
Interp Status:   --- 
Final Accepted Text:
==  
Date Submitted: 2016-12-09  17:00 UTC
Last Modified:   2016-12-09 17:00  UTC
==  
Summary:   LONG_MIN must be <= -2147483648
Description: 
limits.h  says

LONG_MIN
Minimum value for an object of type  long.
Maximum Acceptable Value: -2 147 483 647

but mrand48()  and jrand48() apis return long which is specified to
be uniform in [  -2147483648, 2147483647 ]

so on a conforming implementation LONG_MIN  <= -2147483648 must hold.

Desired Action: 
change the LONG_MIN  text to

Maximum Acceptable Value: -2 147 483 648

with CX shading  (or add this with XSI shading, since mrand48 and jrand48
are XSI  apis).


==  

Issue History 
Date ModifiedUsername Field Change
==  
2016-12-09 17:00 nszNew  Issue 
2016-12-09 17:00  nszName => Szabolcs  Nagy   
2016-12-09 17:00 nsz   Organization  => musl  libc  
 
2016-12-09 17:00 nsz   Section   => limits.h 
==





[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2016-12-09 Thread Austin Group Bug Tracker

A NOTE has been added to this issue. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: New
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text: 
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2016-12-09 18:40 UTC
== 
Summary:LONG_MIN must be <= -2147483648
== 

-- 
 (0003512) EdSchouten (reporter) - 2016-12-09 18:40
 http://austingroupbugs.net/view.php?id=1108#c3512 
-- 
Hey! Thanks for filing this defect. I guess this problem also applies to
a64l() and l64a().

In http://austingroupbugs.net/view.php?id=1106 I already proposed changing
the prototype of jrand48() to use uint16_t instead of unsigned short. Maybe
we should just leave the definition of LONG_MIN the way it is now, but fix
up the functions to use int32_t while we're at it? I guess if you would
design functions like these from scratch, you would have used int32_t
anyway. 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
2016-12-09 18:40 EdSchouten Note Added: 0003512  
==




[1003.1(2016)/Issue7+TC2 0001108]: LONG_MIN must be <= -2147483648

2016-12-09 Thread Austin Group Bug Tracker

The following issue has been SUBMITTED. 
== 
http://austingroupbugs.net/view.php?id=1108 
== 
Reported By:nsz
Assigned To:
== 
Project:1003.1(2016)/Issue7+TC2
Issue ID:   1108
Category:   Base Definitions and Headers
Type:   Error
Severity:   Editorial
Priority:   normal
Status: New
Name:   Szabolcs Nagy 
Organization:   musl libc 
User Reference:  
Section:limits.h 
Page Number: 
Line Number: 
Interp Status:  --- 
Final Accepted Text: 
== 
Date Submitted: 2016-12-09 17:00 UTC
Last Modified:  2016-12-09 17:00 UTC
== 
Summary:LONG_MIN must be <= -2147483648
Description: 
limits.h says

  LONG_MIN
  Minimum value for an object of type long.
  Maximum Acceptable Value: -2 147 483 647

but mrand48() and jrand48() apis return long which is specified to
be uniform in [ -2147483648, 2147483647 ]

so on a conforming implementation LONG_MIN <= -2147483648 must hold.

Desired Action: 
change the LONG_MIN text to

Maximum Acceptable Value: -2 147 483 648

with CX shading (or add this with XSI shading, since mrand48 and jrand48
are XSI apis).


== 

Issue History 
Date ModifiedUsername   FieldChange   
== 
2016-12-09 17:00 nszNew Issue
2016-12-09 17:00 nszName  => Szabolcs Nagy   
2016-12-09 17:00 nszOrganization  => musl libc   
2016-12-09 17:00 nszSection   => limits.h
==