Bug 216078 - games/valyriatear: fails to build with lang/gcc6 or later
Summary: games/valyriatear: fails to build with lang/gcc6 or later
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dmitry Marakasov
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2017-01-14 16:34 UTC by Jan Beich
Modified: 2017-08-24 14:14 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (amdmi3)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2017-01-14 16:34:30 UTC
src/main.cpp:508:53: warning:
      comparison between NULL and non-pointer ('std::ifstream' (aka 'basic_ifstream<char>') and NULL)
      [-Wnull-arithmetic]
        if(std::ifstream("dat/config/settings.lua") == NULL) {
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~
src/main.cpp:508:53: error: invalid
      operands to binary expression ('std::ifstream' (aka 'basic_ifstream<char>') and 'long')
        if(std::ifstream("dat/config/settings.lua") == NULL) {
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~

build log: http://sprunge.us/eYWc
regressed by: https://github.com/llvm-mirror/libcxx/commit/3a1b90a866b6
Comment 1 Jan Beich freebsd_committer freebsd_triage 2017-01-14 16:37:27 UTC
src/engine/system.cpp:338:66: error: invalid operands to binary expression ('std::ifstream' (aka 'basic_ifstream<char>') and 'long')
    if(std::ifstream("po/en@quot/LC_MESSAGES/"APPSHORTNAME".mo") == NULL) {
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~
Comment 2 Jan Beich freebsd_committer freebsd_triage 2017-01-14 16:40:15 UTC
(In reply to Dimitry Andric from bug 216034 comment #6)
> Note that the upstream author has reverted the commit causing this here:
>
> http://llvm.org/viewvc/llvm-project?rev=291921&view=rev
>
> and has also merged it to the 4.0 branch. I will import the upstream
> branch into the projects/clang400-import branch soon.

lang/gcc6 and later versions are also affected.

src/main.cpp: In function 'int main(int, char**)':
src/main.cpp:508:53: error: no match for 'operator==' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'long int')
         if(std::ifstream("dat/config/settings.lua") == NULL) {
                                                     ^
src/engine/system.cpp: In function 'void vt_system::Reinitl10n()':
src/engine/system.cpp:338:66: error: no match for 'operator==' (operand types are 'std::ifstream {aka std::basic_ifstream<char>}' and 'long int')
     if(std::ifstream("po/en@quot/LC_MESSAGES/"APPSHORTNAME".mo") == NULL) {
                                                                  ^
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-08-24 14:14:01 UTC
A commit references this bug:

Author: amdmi3
Date: Thu Aug 24 14:13:48 UTC 2017
New revision: 448671
URL: https://svnweb.freebsd.org/changeset/ports/448671

Log:
  - Fix built with gcc6

  PR:		216078
  Reported by:	jbeich

Changes:
  head/games/valyriatear/files/patch-src_main.cpp