[cfe-dev] clang and -pedantic

Marshall Clow mclow.lists at gmail.com
Tue Jan 18 09:36:11 PST 2011


I got some warnings while compiling part of boost with clang TOT.
In particular, it warned about "extra ; in class definitions"

> In file included from ../../../libs/test/src/unit_test_monitor.cpp:16:
> In file included from ../../../boost/test/impl/unit_test_monitor.ipp:22:
> In file included from ../../../boost/test/test_tools.hpp:19:
> ../../../boost/test/predicate_result.hpp:44:37: warning: extra ';' inside a struct [-pedantic]
>     struct dummy { void nonnull() {}; };

So (after some prodding), I looked in the standard and found section 9.2 (class members), where it
appears to show that the semicolon after the member function definition is optional.

Then I went to http://clang.llvm.org/docs/UsersManual.html , where it says that 
> 	-pedantic: Warn on language extensions.

It seems to me that the extra semicolon is not a language extension.

What is the rationale behind having it warn, then?


-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists at gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki





More information about the cfe-dev mailing list