Opened 11 years ago

Closed 8 years ago

#203 closed defect (fixed)

MIN/MAX macros

Reported by: komh 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 komh 11 years ago.
Patches for sys/param.h
param.2.diff (489 bytes) - added by komh 9 years ago.
Adding a missing bracket ')' at the end of #define statement

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by komh

Patches for sys/param.h

comment:1 Changed 9 years ago by bird

  • Keywords MIN MAX sys/param.h added
  • Milestone set to libc-0.6.4
  • Version set to 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 9 years ago by komh

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 9 years ago by komh

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

comment:3 Changed 8 years ago by bird

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

comment:4 Changed 8 years ago by bird

  • Resolution set to fixed
  • Status changed from new to closed

(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.