develooper Front page | perl.perl5.porters | Postings from May 2012

Re: [perl #112786] perlbug AutoReply: build broken under clang++

Thread Next
From:
Craig A. Berry
Date:
May 6, 2012 16:48
Subject:
Re: [perl #112786] perlbug AutoReply: build broken under clang++
Message ID:
9B2968B2-268E-46F7-BB5B-E1E226EAC7E2@mac.com
clang++ seems to need only an extra set of parentheses to calm down and let go of its anxieties:

% git diff
diff --git a/sv.c b/sv.c
index 3ac2fd8..1713977 100644
--- a/sv.c
+++ b/sv.c
@@ -13966,7 +13966,7 @@ Perl_varname(pTHX_ const GV *const gv, const char gvtype, PADOFFSET targ,
        }
     }
     else {
-       CV * const cv = gv ? (CV *)gv : find_runcv(NULL);
+       CV * const cv = gv ? ((CV *)gv) : find_runcv(NULL);
        SV *sv;
        AV *av;
 
[snip]

IMO, something like this ought to go in for 5.16.0 because it is a build failure, and clang++ is a compiler,[1] and someone not knowing any better might try to compile Perl with it.

Those dozens or hundreds of you who actually use C++ at the day job and/or know something about C++ parsing rules may want to chime in about whether clang++ has gone slightly bonkers or is just living out its identity as its own eccentric, hypersensitive C++ self.

[1]  Thanks to Apple's XCode, an increasingly ubiquitous one.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About