[llvm-bugs] [Bug 48746] command line defines are truncated at double slash

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jan 14 00:05:43 PST 2021


https://bugs.llvm.org/show_bug.cgi?id=48746

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
-DTFILE="/some/path//foo/bar"

is equivalent to

-DTFILE=/some/path//foo/bar

by shell escaping rules, which is equivalent to prefixing the input with

#define TFILE /some/path//foo/bar

by POSIX rules for the behavior of -D.

This defines TFILE to /some/path followed by a comment, in language modes that
recognize // comments (Clang's default language modes for C and C++ recognize
such comments).

You can use -std=c89 to disable support for // comments.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210114/29cf03d5/attachment-0001.html>


More information about the llvm-bugs mailing list