View Issue Details

IDProjectCategoryView StatusLast Update
00019031003.1(2024)/Issue8Shell and Utilitiespublic2025-02-04 10:26
ReporterLove4Boobies Assigned To 
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionRejected 
NameBogdan Barbu
Organization
User Reference
Sectionmake
Page Numberhttps://pubs.opengroup.org/onlinepubs/9799919799/utilities/make.html
Line NumberN/A
Interp Status---
Final Accepted Text
Summary0001903: Default target description omits pattern rules
DescriptionThere are two instances where pattern rules such as %.o:%.c are not considered because they fall neither under special targets nor under inference rules according to the specification.

1. In the OPERANDS section: "If no target is specified, while make is processing the makefiles, the first target that make encounters that is not a special target or an inference rule shall be used."

2. In the EXTENDED DESCRIPTION, in the INCLUDE LINES subsection, where the delayed remaking method is described: "The first target make encounters that is not a special target or an inference rule, if no target_name operands are specified."
Desired ActionAdjust for the introduction of pattern rules in Issue 8.
TagsNo tags attached.

Activities

Love4Boobies

2025-01-29 04:12

reporter   bugnote:0007058

(Obviously, they should be skipped.)

Don Cragun

2025-01-30 16:57

manager   bugnote:0007059

On P2343, L105906-105914 the standard says:
The application shall ensure that the target portion is a valid target name (see Target Rules, on page 3137) of the form .s2 or .s1.s2 (where .s1 and .s2 are suffixes that have been given as prerequisites of the .SUFFIXES special target and s1 and s2 do not contain any <slash> or <period> characters.) If there is only one <period> in the target, it is a single-suffix inference rule. Targets with two periods are double-suffix inference rules. Inference rules can have only one target before the <colon>.
so a rule that starts with %.o:%.c is a double-suffix inference rule.

Note also that macro definitions can be included in makefiles, but macro definitions do not have targets. Since they don't have targets, a target cannot be found in a macro definition.

We do not see any problem with the current wording in the standard. Therefore, this bug is rejected.

Don Cragun

2025-01-30 17:11

manager   bugnote:0007060

Actually, %.c:%.o ... is a macro definition; not a double suffix inference rule. But a target is still not defined by that macro definition and the reasoning in 0001903:0007059 to reject this bug still applies.

geoffclare

2025-02-04 10:26

manager   bugnote:0007062

Last edited: 2025-02-04 11:01

I agree with the rejection of this bug, but I believe neither of the preceding two notes is correct.

%.o:%.c is a target rule with target name %.o and prerequisite %.c

On page 3137 lines 105648-105652 the standard says:
Applications shall select target names from the set of characters consisting solely of slashes, hyphens, periods, underscores, digits, and alphabetics from the portable character set (see XBD Section 6.1, on page 117). Implementations may allow other characters in target names as extensions. The interpretation of targets containing the characters '%' and '"' is implementation-defined.

Therefore the target name %.o might not be accepted at all, and if it is accepted the behaviour is implementation-defined.

This bug seems to have been submitted under the misapprehension (stated in the Desired Action) that Issue 8 added "pattern rules". It did not; it only added pattern macro expansions.

Issue History

Date Modified Username Field Change
2025-01-29 04:10 Love4Boobies New Issue
2025-01-29 04:10 Love4Boobies Name => Bogdan Barbu
2025-01-29 04:10 Love4Boobies Section => make
2025-01-29 04:10 Love4Boobies Page Number => https://pubs.opengroup.org/onlinepubs/9799919799/utilities/make.html
2025-01-29 04:10 Love4Boobies Line Number => N/A
2025-01-29 04:12 Love4Boobies Note Added: 0007058
2025-01-30 16:57 Don Cragun Note Added: 0007059
2025-01-30 16:58 Don Cragun Interp Status => ---
2025-01-30 16:58 Don Cragun Status New => Closed
2025-01-30 16:58 Don Cragun Resolution Open => Rejected
2025-01-30 17:11 Don Cragun Note Added: 0007060
2025-02-04 10:26 geoffclare Note Added: 0007062
2025-02-04 11:01 geoffclare Note Edited: 0007062