Opened 14 years ago

Closed 11 years ago

#2115 closed Bugs (fixed)

Avoid bad Apple macros

Reported by: Dave Abrahams Owned by: Beman Dawes
Milestone: Boost 1.36.0 Component: inspection script
Version: Boost 1.35.0 Severity: Problem
Keywords: Cc: John Maddock, mateusz@…

Description

Apple has a header called <AssertMacros.h> that #defines both “check” and “check_error.” These macros naturally collide with the same names in Boost. We should consider a global change. That would also probably require a global policy change for checkins.

Assigning to Beman, Cc'ing John M, component "inspection script" assigned to John although I might be wrong about that, but obviously we need to discuss this. Maybe we'll decide to make it "wontfix"

Attachments (1)

is_incrementable.hpp (3.5 KB ) - added by Foster Brereton <fbrereto@…> 14 years ago.
is_incrementable.hpp patch

Download all attachments as: .zip

Change History (10)

comment:1 by Marshall Clow, 14 years ago

Just F-everyone's-I, here's a list of the macros defined in AssertMacros.h:

debug_string, check, ncheck, check_string, ncheck_string, check_noerr, check_noerr_string, verify, nverify, verify_string, nverify_string, verify_noerr, verify_noerr_string, verify_action, require, nrequire, require_action, nrequire_action, require_quiet, nrequire_quiet, require_action_quiet, nrequire_action_quiet, require_string, nrequire_string, requireaction_string, nrequireaction_string, require_noerr, require_noerr_action, require_noerr_quiet, require_noerr_action_quiet, require_noerr_string, require_noerr_action_string.

IMHO, the really nasty ones are: check, verify, require and check_error.

My suggestion is to #define ASSERTMACROS in the darwin Jamfile, and to add a warning to the docs.

comment:2 by Marshall Clow, 14 years ago

The Wiki decided some of my text was formatting. The macro to define is "_ _ ASSERTMACROS _ _ " (w/o the spaces)

comment:3 by Beman Dawes, 14 years ago

Status: newassigned

comment:4 by Foster Brereton <fbrereto@…>, 14 years ago

Made changes to boost/detail/is_incrementable.hpp to get it to compile in the presence of the Apple check macro. Please see attached file.

by Foster Brereton <fbrereto@…>, 14 years ago

Attachment: is_incrementable.hpp added

is_incrementable.hpp patch

comment:5 by John Maddock, 14 years ago

We've let this issue drop,

but... since we have the macro BOOST_PREVENT_MACRO_SUBSTITUTION to suppress this kind of unexpected macro substitution, maybe we should just go ahead and add all the Apple macros to the inspect program?

John.

comment:6 by Dave Abrahams, 14 years ago

Perhaps sadly, I have to agree.

comment:7 by Marshall Clow, 13 years ago

I have added the ability to find "check", "require", "verify" and "check_error" to the inspection program. It found almost 3000 files using these identifiers (2899, to be precise).

Cleaning this up is going to be a large task.

comment:8 by Mateusz Loskot, 13 years ago

Cc: mateusz@… added

comment:9 by Beman Dawes, 11 years ago

Resolution: fixed
Status: assignedclosed

Closing inactive ticket

--Beman

Note: See TracTickets for help on using tickets.