Opened 16 years ago

Closed 13 years ago

#203 closed defect (fixed)

MIN/MAX macros

Reported by: KO Myung-Hun Owned by: bird
Priority: normal Milestone: libc-0.6.4
Component: libc Version: 0.6.2
Severity: normal Keywords: MIN MAX sys/param.h
Cc:

Description

Hi/2.

Why should we define MIN/MAX macros this way in sys/param.h ?

g++ does not understand them.

Just define them normally.

KO Myung-Hun

Attachments (2)

param.diff (637 bytes) - added by KO Myung-Hun 16 years ago.
Patches for sys/param.h
param.2.diff (489 bytes) - added by KO Myung-Hun 13 years ago.
Adding a missing bracket ')' at the end of #define statement

Download all attachments as: .zip

Change History (6)

Changed 16 years ago by KO Myung-Hun

Attachment: param.diff added

Patches for sys/param.h

comment:1 Changed 13 years ago by bird

Keywords: MIN MAX sys/param.h added
Milestone: libc-0.6.4
Version: 0.6.2

The sys/param.h header is using the min and max operators of gcc/g++ to avoid evaluating the winning expressions twice: http://gcc.gnu.org/onlinedocs/gcc-3.3.6/gcc/Min-and-Max.html

This operator was removed with 4.2.0, kLIBC v0.6 ships with 3.3.x so I guess you're using Paul's newer compiler builds then. Will make it work optimally for 3.x as well as 4.x.

comment:2 Changed 13 years ago by KO Myung-Hun

Ah, Ok.

And I've found the cause.

The closing bracket ')' is missing at the end of the define statement.

Why didn't I find this before ?

Changed 13 years ago by KO Myung-Hun

Attachment: param.2.diff added

Adding a missing bracket ')' at the end of #define statement

comment:3 Changed 13 years ago by bird

(In [3681]) sys/param.h: MIN & MAX fixes for gcc 4.2.0 and later. References #203.

comment:4 Changed 13 years ago by bird

Resolution: fixed
Status: newclosed

(In [3682]) 0.6: Backported 3670: sys/param.h: MIN & MAX fixes for gcc 4.2.0 and later. Fixes #203.

Note: See TracTickets for help on using tickets.