SimpleExample warnings

Issue #4 resolved
Frank Dellaert created an issue

The anonymous namespaces in tests/smallExample.h seem to confuse Clang, and it spits out warnings on make check. Assigned to clang/Mavericks fan Nate to see whether he will do it and generate our first pull request :-)

Comments (8)

  1. Nathan Michael

    Clang interprets the function definition as appearing in each implementation. LLVM coding standards suggest minimal anonymous namespaces for class objects. See also the remark on the Google style guide:

    Use of unnamed namespaces in header files can easily cause violations of the C++ One Definition Rule (ODR).

    The fix is easy - remove the anonymous namespace declaration. It appears to be unnecessary.

    I am unable to fork the repo as I do not have write access and public forks are not permitted. Creating a pull request entails forking, committing changes, then generating the request. It would make limited sense for me to be able to fork into an alternate namespace (e.g., personal) as then I could assert admin rights and make the fork public.

  2. Frank Dellaert reporter

    Actually, there was some reason - I think they were inserted to fix some compile error with some gcc version. I propose we wait until Alex is added to BitBucket, as I think he did this.

  3. Alex Cunningham

    I didn't actually add the anonymous namespace - Richard added it due to an issue with duplicate symbols when building in SINGLE_TEST_EXE mode (see git commit ID: 14a71aeedc18103a97a88940d73f3fc48be3987e). The other option for getting around this problem is to not separate the implementations from the definitions, which should also solve the problem.

  4. Log in to comment