Bug 177893 - Disable -Wcast-qual for new clang compiler in Apple ports
Summary: Disable -Wcast-qual for new clang compiler in Apple ports
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks: 177895
  Show dependency treegraph
 
Reported: 2017-10-04 13:04 PDT by David Kilzer (:ddkilzer)
Modified: 2017-10-11 11:09 PDT (History)
8 users (show)

See Also:


Attachments
Patch v1 (3.73 KB, patch)
2017-10-04 13:52 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2017-10-04 13:04:43 PDT
We need to temporarily disable -Wcast-qual in WebCore for a new clang compiler until a new cast function can be made to do the casts safely (and without using reinterpret_cast<>(const_cast<>()) operators everywhere).

This also turns off the -Wcast-qual warning for one part of RetainPtr<>.

All of these warnings are due to casting a const CFTypeRef (or sometimes a const void*, which is the return type of functions like CFArrayGetValueAtIndex()) to a non-const CFTypeRef in C++ or Objective-C++ code.

<rdar://problem/33667497>
Comment 1 David Kilzer (:ddkilzer) 2017-10-04 13:52:37 PDT
Created attachment 322715 [details]
Patch v1
Comment 2 WebKit Commit Bot 2017-10-05 12:12:08 PDT
Comment on attachment 322715 [details]
Patch v1

Clearing flags on attachment: 322715

Committed r222928: <http://trac.webkit.org/changeset/222928>
Comment 3 WebKit Commit Bot 2017-10-05 12:12:10 PDT
All reviewed patches have been landed.  Closing bug.
Comment 4 Darin Adler 2017-10-07 13:33:59 PDT
(In reply to David Kilzer (:ddkilzer) from comment #0)
> We need to temporarily disable -Wcast-qual in WebCore for a new clang
> compiler until a new cast function can be made to do the casts safely (and
> without using reinterpret_cast<>(const_cast<>()) operators everywhere).
> 
> This also turns off the -Wcast-qual warning for one part of RetainPtr<>.
> 
> All of these warnings are due to casting a const CFTypeRef (or sometimes a
> const void*, which is the return type of functions like
> CFArrayGetValueAtIndex()) to a non-const CFTypeRef in C++ or Objective-C++
> code.

I’d really like to get this turned back on. Is someone working on the new cast?
Comment 5 David Kilzer (:ddkilzer) 2017-10-11 11:09:51 PDT
(In reply to Darin Adler from comment #4)
> (In reply to David Kilzer (:ddkilzer) from comment #0)
> > We need to temporarily disable -Wcast-qual in WebCore for a new clang
> > compiler until a new cast function can be made to do the casts safely (and
> > without using reinterpret_cast<>(const_cast<>()) operators everywhere).
> > 
> > This also turns off the -Wcast-qual warning for one part of RetainPtr<>.
> > 
> > All of these warnings are due to casting a const CFTypeRef (or sometimes a
> > const void*, which is the return type of functions like
> > CFArrayGetValueAtIndex()) to a non-const CFTypeRef in C++ or Objective-C++
> > code.
> 
> I’d really like to get this turned back on. Is someone working on the new
> cast?

It's being tracked here:  Bug 177895: Re-enable -Wcast-qual for Apple ports