Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#8733 closed Feature Requests (fixed)

Testing for unprotected references to C99 math macros

Reported by: Mike Liang <mtliang@…> Owned by: johnmaddock
Milestone: To Be Determined Component: math
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:


Attached is a way to test for unprotected references to C99 math macros on platforms where they are implemented as functions. Adding this to a released header would make it convenient to test new code for any omissions.

I used this to find the problems submitted in ticket #8732.

With, for example, fpclassify redefined, any unprotected references will expand out to a syntax error.

#define fpclassify(x) (another_fpclassify(x))
bad_call = boost::math::fpclassify(arg);


bad_call = boost::math::(another_flclassify(arg));

Attachments (1)

math_fwd.hpp.patch (1.7 KB) - added by Mike Liang <mtliang@…> 4 years ago.
simulate C99 math macros

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by Mike Liang <mtliang@…>

simulate C99 math macros

comment:1 Changed 4 years ago by johnmaddock

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

(In [84917]) Add test for things that are macros in C99 to ensure we call these correctly. Refs #8732. Fixes #8733.

comment:2 Changed 4 years ago by johnmaddock

(In [85987]) Merge accumulated patches from Trunk. Refs #8384, Refs #8855, refs #9107, refs #9109, refs #8333, refs #8621, refs #8732, refs #8733, refs #8837, refs #8940, refs #9042, refs #9087, refs #9104, refs #9126.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain johnmaddock.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.