Austin Group Defect Tracker

Aardvark Mark IV

Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000624 [1003.1(2008)/Issue 7] System Interfaces Editorial Clarification Requested 2012-10-15 17:53 2019-06-10 08:55
Reporter nsz View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Szabolcs Nagy
User Reference
Section pthread_cleanup_pop
Page Number 1574
Line Number 50552
Interp Status Approved
Final Accepted Text See Note: 0001435
Summary 0000624: pthread_cleanup_pop and _push should be macro only
Description pthread_cleanup_pop and pthread_cleanup_push are required
to have a prototype in pthread.h[1] and they need to be
available as functions[2], a macro implementation is not

these functions are expected to be implemented as macros
because a correct function implementation is hard to do.

the requirement to have them as regular functions is too

[1] pthread.h contains the usual disclamer before the list of functions:

"The following shall be declared as functions and may also be defined
as macros. Function prototypes shall be provided."

[2] from section 2.1.1:

"Any macro definition of a function can be suppressed locally by
enclosing the name of the function in parentheses, [...].
The use of the C-language #undef construct to remove any such macro
definition shall also ensure that an actual function is referred to."

"Provided that a function can be declared without reference to any
type defined in a header, it is also permissible to declare the
function explicitly and use it without including its associated

Desired Action allow pthread_cleanup_pop and pthread_cleanup_push
to only have a macro definition in pthread.h

so #undef-ing or otherwise suppressing these macros
may not make a function version available and there
may not be a prototype available in pthread.h
Tags tc2-2008
Attached Files

- Relationships

-  Notes
nick (manager)
2012-12-20 17:20
edited on: 2012-12-20 17:32

Interpretation response
The standard states that pthread_cleanup_push and pthread_cleanup_pop shall be
implemented as functions as well as macros, and conforming implementations must
conform to this. However, concerns have been raised about this which are being
referred to the sponsor.

Existing implementations exclusively implement these functions as function-like
macros, and do not provide any underlying function. The application usage and
rationale provided show an implementation that only works as a macro.

Notes to the Editor (not part of this interpretation):

Page 1574 line 50552
change "These functions may be implemented as macros. " to:

It is unspecified whether pthread_cleanup_push and pthread_cleanup_pop are
macros or functions. If a macro definition is suppressed in order to access
an actual function, or a program defines an external identifier with any of these names
the behavior is undefined.

Cross Volume change to XBD, page 312 lines 10448 and 10449:
delete pthread_cleanup_push and pthread_cleanup_pop from this list.

Add a new paragraph after line 10542:

The following may be declared as functions, or defined as macros, or both.
If functions are declared, function prototypes shall be provided.


ajosey (manager)
2013-03-29 08:05

Interpretation Proposed 29 Mar 2013
ajosey (manager)
2013-05-03 12:19

Interpretation approved 3 May 2013

- Issue History
Date Modified Username Field Change
2012-10-15 17:53 nsz New Issue
2012-10-15 17:53 nsz Status New => Under Review
2012-10-15 17:53 nsz Assigned To => ajosey
2012-10-15 17:53 nsz Name => Szabolcs Nagy
2012-10-15 17:53 nsz Section => pthread_cleanup_pop
2012-10-15 17:53 nsz Page Number => 0
2012-10-15 17:53 nsz Line Number => 0
2012-12-20 17:20 nick Note Added: 0001435
2012-12-20 17:22 nick Page Number 0 => 1574
2012-12-20 17:22 nick Line Number 0 => 50552
2012-12-20 17:22 nick Interp Status => Pending
2012-12-20 17:22 nick Final Accepted Text => See Note: 0001435
2012-12-20 17:22 nick Status Under Review => Interpretation Required
2012-12-20 17:22 nick Resolution Open => Accepted As Marked
2012-12-20 17:22 nick Tag Attached: tc2-2008
2012-12-20 17:23 nick Note Edited: 0001435
2012-12-20 17:27 nick Note Edited: 0001435
2012-12-20 17:32 nick Note Edited: 0001435
2013-03-29 08:05 ajosey Interp Status Pending => Proposed
2013-03-29 08:05 ajosey Note Added: 0001521
2013-05-03 12:19 ajosey Interp Status Proposed => Approved
2013-05-03 12:19 ajosey Note Added: 0001574
2019-06-10 08:55 agadmin Status Interpretation Required => Closed

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker