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
0000866 [1003.1(2013)/Issue7+TC1] Shell and Utilities Editorial Enhancement Request 2014-08-12 09:43 2019-06-10 08:54
Reporter antoinel View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Antoine Leca
Organization
User Reference
Section make
Page Number 2928
Line Number 96368
Interp Status ---
Final Accepted Text See Note: 0002392
Summary 0000866: No precedence between include lines and macro definitions
Description The Standard does not prescribe an order of evaluation between include lines and macro definitions. Furthermore, various implementations chose distinct interpretations for
include =foo.mk


Given the low actual usefulness of such a construct, it does not seem important to try to choose between interpretations (which would automatically render the other half of the implementations theoretically not conforming.) Rather, we could suggest workarounds to let applications avoid the pitfall.
Desired Action Add a new paragraph to RATIONALE after P2928, L96368:
The standard does not prescribe the precedence between include lines and macro definitions. As such, the effect of
include =foo.mk

is unspecified. To define a variable named include, either the whitespace before the <equal-sign> should be removed, or another macro should be used, as in
INCLUDE_NAME = include
$(INCLUDE_NAME) =foo.mk

On the other hand, if the intent is to include a file which starts with an <equal-sign>, the makefile should be written as
INCLUDE_FILE = =foo.mk
include $(INCLUDE_FILE)
Tags tc2-2008
Attached Files

- Relationships

-  Notes
(0002392)
nick (manager)
2014-09-18 16:35
edited on: 2014-09-18 16:46

Add the following to APPLICATION USAGE: after line 97603

This version of POSIX.1:2008 does not specify precedence between macro
definition and include directives. Thus the behavior of
        include =foo.mk

is unspecified. To define a variable named include, either the whitespace
before the <equal-sign> should be removed, or another macro should be
used, as in
        INCLUDE_NAME = include
        $(INCLUDE_NAME) =foo.mk


On the other hand, if the intent is to include a file which starts with an
<equal-sign>, either the filename should be changed to <tt>./=foo.mk</tt>,
or the makefile should be written as
        INCLUDE_FILE = =foo.mk
        include $(INCLUDE_FILE)


(0002394)
shware_systems (reporter)
2014-09-18 17:16

Editorial: <tt> </tt> should be replaced with " directly, or just removed from Note 2932.

Should some mention of equals not being a portable filename character, so use of a filename containing it may not work properly anyways with all file systems, be added? This ambiguity, necessitating those example workarounds, arises only with non-portable makefiles, in other words.

- Issue History
Date Modified Username Field Change
2014-08-12 09:43 antoinel New Issue
2014-08-12 09:43 antoinel Name => Antoine Leca
2014-08-12 09:43 antoinel Section => make
2014-08-12 09:43 antoinel Page Number => 2928
2014-08-12 09:43 antoinel Line Number => 96368
2014-09-18 16:35 nick Note Added: 0002392
2014-09-18 16:36 nick Interp Status => ---
2014-09-18 16:36 nick Final Accepted Text => See Note: 0002392
2014-09-18 16:36 nick Status New => Resolved
2014-09-18 16:36 nick Resolution Open => Accepted As Marked
2014-09-18 16:36 nick Desired Action Updated
2014-09-18 16:37 nick Tag Attached: tc2-2008
2014-09-18 16:45 Don Cragun Note Edited: 0002392
2014-09-18 16:46 Don Cragun Note Edited: 0002392
2014-09-18 17:16 shware_systems Note Added: 0002394
2019-06-10 08:54 agadmin Status Resolved => Closed


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