Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c++ Subject: Re: An example: code to list exports of a Windows DLL. Date: Tue, 20 Aug 2019 14:21:06 -0700 Organization: None to speak of Lines: 39 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="eda0362a42d89c1a502f45f546af142c"; logging-data="7441"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/VvfF67ABBuwf6CaxfXNa" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:1pf2dxWv7Z03sCiiqVjyWFyDKJk= sha1:ZV1hAP8RZaMl1N+fVyU1j7cWq5s= Xref: csiph.com comp.lang.c++:67822 Ian Collins writes: > On 20/08/2019 21:18, Keith Thompson wrote: [...] >> Can you demonstrate that? I haven't been able to do so, with several >> versions of g++ (up to and including a bleeding-edge version I built >> from source a week and a half ago). Here's the test case I used: >> >> #include >> int main() { >> const int foo$bar = 42; >> std::cout << foo$bar << "\n"; >> } >> >> compiled with "g++ -Wpedantic -std=c++17". No warning from any version >> I have on my system. > > Try clang: > > $ clang++ -Wpedantic -std=c++17 /tmp/x.cc > /tmp/x.cc:3:18: warning: '$' in identifier > [-Wdollar-in-identifier-extension] > const int foo$bar = 42; > ^ > /tmp/x.cc:4:21: warning: '$' in identifier > [-Wdollar-in-identifier-extension] > std::cout << foo$bar << "\n"; > ^ > 2 warnings generated. > $ clang++ --version > clang version 8.0.1-svn363027-1~exp1~20190611211629.77 (branches/release_80) Yes, I had already tried clang. It allows '$' in identifiers, but warns about them in conforming mode, which agrees with my interpretation of what the C++17 standard requires. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */