Clang6 compilation issues

Issue #151 resolved
adridg created an issue

(This is vaguely related to another, open issue titled "Compilation errors with GCC7 ", #132)

Clang6 is quite strict about C++11 compliance, and defaults to C++11. Assuming Coin3D is supposed to be C++11, the following issues show up in Coin 3.1.3:

SoOffscreenRenderer.cpp:1658:29: error: non-constant-expression cannot be
      narrowed from type 'unsigned int' to 'int' in initializer list
      [-Wc++11-narrowing]
    const int vpsize[2] = { this->glcanvassize[0], this->glcanvassize[1] };

This can be trivially fixed (er .. hidden away to avoid compile errors) by changing (line 391) the declaration of glcanvassize to unsigned int, but that may have knock-on effects.

SoStream.cpp:425:42: error: assigning to 'char *' from incompatible type
      'char'

There are two instances of s = '\0' which need to be changed to *s = '\0' -- that is mentioned in the GCC compile failure issue.

SoProfilerVisualizeKit.cpp:143:43: error: cannot initialize a parameter of
      type 'SbBool' (aka 'int') with an rvalue of type 'nullptr_t'
  this->separatorsWithGLCaches.setDefault(NULL);

That NULL should be false or 0, it assumes the old-fashioned definition of NULL as some kind of integer 0.

Comments (5)

  1. adridg reporter

    .. and the unsigned int was done (by Bastiaan) in 11603, and the SbBool was done in 11469 already. Once again, Bassie is way faster than Adriaan.

    Closing this one, and switching my efforts to backporting these compile fixes to the Coin packaging on FreeBSD (which is still 3.1.3, the latest release).

  2. Bastiaan Veelo

    Bassie is way faster than Adriaan.

    Lol, how many ready this would get this joke? I do.

    backporting these compile fixes to the Coin packaging on FreeBSD (which is still 3.1.3, the latest release).

    Yes, that is the real bug: we don't have a release manager. We really should tag a new release.

  3. Log in to comment