+
Skip to content

incorrect handling of empty substitutions #8

@vapier

Description

@vapier

POSIX defines substitutions:

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html#tag_20_76_13_05
Macro expansions using the forms $(string1 [: subst1 =[ subst2 ]]) or ${ string1 [: subst1 =[ subst2 ]]} can be used to replace all occurrences of subst1 with subst2 when the macro substitution is performed. The subst1 to be replaced shall be recognized when it is a suffix at the end of a word in string1 (where a word, in this context, is defined to be a string delimited by the beginning of the line, a , or a ). If string1 in a macro expansion contains a macro expansion, the results are unspecified. If a character appears as part of subst1 or subst2 after any macros have been recursively expanded, the results are unspecified.

if subst2 is omitted, dmake incorrectly throws an error.

Makefile:

foo.o:
	echo $(@:.o=)
$ dmake
dmake:  Error: -- Incomplete macro expression [)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载