Bug 224988

Summary: games/iortcw: fails to build with clang 6.0
Product: Ports & Packages Reporter: Jan Beich <jbeich>
Component: Individual Port(s)Assignee: Tobias Kortkamp <tobik>
Status: Closed FIXED    
Severity: Affects Only Me Keywords: needs-patch
Priority: --- Flags: bugzilla: maintainer-feedback? (tobik)
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 224669    

Description Jan Beich freebsd_committer freebsd_triage 2018-01-08 11:43:19 UTC
FreeBSD -CURRENT plans to update base Clang to 6.0.0 soon. While testing this port failed to build.

code/splines/util_str.cpp:477:11: error: reinterpret_cast from 'nullptr_t' to 'const char *' is not allowed
        idStr e( reinterpret_cast<const char *>( NULL ) );
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
code/splines/util_str.cpp:491:10: error: reinterpret_cast from 'nullptr_t' to 'const char *' is not allowed
        a = c + reinterpret_cast<const char *>( NULL );
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
code/splines/util_str.cpp:494:6: error: reinterpret_cast from 'nullptr_t' to 'const char *' is not allowed
        a = reinterpret_cast<const char *>( NULL ) + d;
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
code/splines/util_str.cpp:498:7: error: reinterpret_cast from 'nullptr_t' to 'const char *' is not allowed
        a += reinterpret_cast<const char *>( NULL );
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To reproduce:
$ poudriere jail -cj clang6-amd64 -a amd64 -v projects/clang600-import -m svn+https
$ poudriere bulk -Ctj clang6-amd64 games/iortcw

http://package18.nyi.freebsd.org/data/headamd64PR224669-default/2018-01-02_08h32m49s/logs/errors/iortcw-1.51,1.log
http://package18.nyi.freebsd.org/data/headi386PR224669-default/2018-01-07_22h53m03s/logs/errors/iortcw-1.51,1.log
Comment 1 Jan Beich freebsd_committer freebsd_triage 2018-01-08 11:44:39 UTC
Maybe use static_cast instead. NULL is promoted to nullptr by base r228918.
Comment 2 Tobias Kortkamp freebsd_committer freebsd_triage 2018-01-08 17:24:04 UTC
Should be fixed now.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-01-08 17:24:09 UTC
A commit references this bug:

Author: tobik
Date: Mon Jan  8 17:23:42 UTC 2018
New revision: 458458
URL: https://svnweb.freebsd.org/changeset/ports/458458

Log:
  games/iortcw: Fix build with clang 6.0

  code/splines/util_str.cpp:477:11: error: reinterpret_cast from 'nullptr_t' to
  'const char *' is not allowed
          idStr e( reinterpret_cast<const char *>( NULL ) );
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  code/splines/util_str.cpp:491:10: error: reinterpret_cast from 'nullptr_t' to
  'const char *' is not allowed
          a = c + reinterpret_cast<const char *>( NULL );
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  code/splines/util_str.cpp:494:6: error: reinterpret_cast from 'nullptr_t' to
  'const char *' is not allowed
          a = reinterpret_cast<const char *>( NULL ) + d;
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  code/splines/util_str.cpp:498:7: error: reinterpret_cast from 'nullptr_t' to
  'const char *' is not allowed
          a += reinterpret_cast<const char *>( NULL );
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  PR:		224988
  Reported by:	jbeich

Changes:
  head/games/iortcw/files/patch-clang6