<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Oct 1, 2013, at 9:41 AM, Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="rtl"><div dir="ltr">I am calling clang using a custom driver, and it seems clang diagnostics state is different than the command line driver. I'm looking into this issue now.</div><div dir="ltr"><br></div><div dir="ltr">
This aside, I think that clang turns off all warnings for system include files, so compiling from the command line effectively hides this warning as well as potential others.</div></div></blockquote><div><br></div>I don't think that's true; (the 'all warnings' part), but lang definitely behaves somewhat differently when compiling a system header file.</div><div><br><blockquote type="cite"><div dir="rtl"><div dir="ltr">So the question is wether this is a real issue or not, as the suffixes in chrono are lacking an underscore but are not user-defined but system-defined. </div></div></blockquote><div><br></div>If you're not compiling a system include file, then that's a fine error.</div><div>UDL's that do not start with '_' are reserved.</div><div><br></div><div>But there has to be a way for libc++ to define them.</div><div><br></div><div>I would say that this is not a real issue.</div><div><br></div><div>-- Marshall</div><div><br></div><div><br><blockquote type="cite"><div class="gmail_extra"></div><div class="gmail_extra"><div class="gmail_quote"><div dir="ltr">2013/10/1 Marshall Clow <span dir="ltr"><<a href="mailto:mclow.lists@gmail.com" target="_blank">mclow.lists@gmail.com</a>></span></div>
<blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex"><div style="word-wrap:break-word"><div><div class="h5"><div>On Sep 30, 2013, at 11:48 PM, Yaron Keren <<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>> wrote:</div>
<br><blockquote type="cite"><div dir="rtl"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">Trying to compile libcxx using ToT clang results in several warnings such as:</div><div dir="ltr"><br></div><div dir="ltr">
<div dir="ltr"><font face="courier new, monospace">libcxx/string:4169:24: warning: user-defined literal suffixes not starting with '_' are reserved</font></div>
<div dir="ltr"><font face="courier new, monospace"> basic_string<char> operator "" s( const char *__str, size_t __len )</font></div><div dir="ltr"><font face="courier new, monospace"><div dir="ltr"><br>
</div><div dir="ltr">libcxx/chrono:955:29: warning: user-defined literal suffixes not starting with '_' are reserved</div><div dir="ltr"> constexpr chrono::hours operator"" h(unsigned long long __h)</div>
</font></div><div dir="ltr"><font face="courier new, monospace"> ^</font></div><div>debugging, I see Sema::CheckLiteralOperatorDeclaration calling NumericLiteralParser::isValidUDSuffix which returns true (valid) for the "s" and "h" suffixes. This prevents the second optional part of the warning, "no literal will invoke this operator" but not the first one shown above.</div>
</div></div></blockquote><br></div></div><div>I'm not seeing this at all (on Mac OS).</div><div><br></div><div>I just built ToT clang and then built libc++ - no warnings.</div><div>Then I tried just building individual source files from libc++ to check. No warnings either.</div>
<div><br></div><div><div>$ /Sources/LLVM/build/llvm-cmake-nodebug/bin/clang++ --version</div><div>clang version 3.4 (trunk 191753)</div><div>Target: x86_64-apple-darwin12.5.0</div><div>Thread model: posix</div><div>$ </div>
<div>$ cd /Sources/LLVM/libcxx/lib</div><div>$ TRIPLE=-apple- CXX=$LLVM/build/llvm-cmake-nodebug/bin/clang++ ./buildit</div><div>[ output snipped; but no warnings ]</div><div>$</div><div>$ TRIPLE=-apple- CXX=$LLVM/build/llvm-cmake-nodebug/bin/clang++ ./buildit14</div>
<div><div>[ buildit14 is a copy of buildit that sets "-std=c++1y" instead of "-std=c++11" ]</div><div>[ output snipped; but no warnings ]</div><div>$</div></div><div>$/Sources/LLVM/build/llvm-cmake-nodebug/bin/clang++ -c -g -Os -arch i386 -arch x86_64 -nostdinc++ -std=c++11 -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion -Wnewline-eof -Wpadded -Wmissing-prototypes -Wstrict-aliasing=2 -Wstrict-overflow=4 -I../include ../src/chrono.cpp</div>
<div>$</div><div>$ /Sources/LLVM/build/llvm-cmake-nodebug/bin/clang++ -c -g -Os -arch i386 -arch x86_64 -nostdinc++ -std=c++1y -fstrict-aliasing -Wall -Wextra -Wshadow -Wconversion -Wnewline-eof -Wpadded -Wmissing-prototypes -Wstrict-aliasing=2 -Wstrict-overflow=4 -I../include ../src/chrono.cpp</div>
<div>$</div><div><br></div></div><br><div>
<span style="border-collapse:separate;border-spacing:0px">-- Marshall<br><br>Marshall Clow Idio Software <<a href="mailto:mclow.lists@gmail.com" target="_blank">mailto:mclow.lists@gmail.com</a>><br><br>A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).<br>
-- Yu Suzuki</span>
</div>
<br></div></blockquote></div><br></div>
</blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px; ">-- Marshall<br><br>Marshall Clow Idio Software <<a href="mailto:mclow.lists@gmail.com">mailto:mclow.lists@gmail.com</a>><br><br>A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).<br> -- Yu Suzuki</span>
</div>
<br></body></html>