coin3d / coin

Coin3D core library
BSD 3-Clause "New" or "Revised" License
281 stars 106 forks source link

Clang6 compilation issues #151

Closed VolkerEnderlein closed 6 years ago

VolkerEnderlein commented 6 years ago

Original report by adridg (Bitbucket: adridg, GitHub: adridg).


(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.

VolkerEnderlein commented 6 years ago

Original comment by Bastiaan Veelo (Bitbucket: veelo, GitHub: veelo).


Thanks. Would you be so kind to submit a pull request? I will gladly pull it.

Bastiaan.

VolkerEnderlein commented 6 years ago

Original comment by adridg (Bitbucket: adridg, GitHub: adridg).


The wrong assignment was already fixed in 11629

VolkerEnderlein commented 6 years ago

Original comment by adridg (Bitbucket: adridg, GitHub: adridg).


.. 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).

VolkerEnderlein commented 6 years ago

Original comment by Bastiaan Veelo (Bitbucket: veelo, GitHub: 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.