This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug objc/77404] Add Wobjc-root-class
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Aug 2016 06:13:06 +0000
- Subject: [Bug objc/77404] Add Wobjc-root-class
- Auto-submitted: auto-generated
- References: <bug-77404-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77404
--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #1)
> (In reply to Tom de Vries from comment #0)
> > Is the -Wobjc-root-class warning something we want to have in gcc objc as
> > well?
>
> What's the reasoning behind clang having it?
My understanding of the reasoning is: when gcc encounters a class that does not
have a super class, either:
a. it's a new root class, or
b. the programmer forgot to specify the super class.
Given that the amount of root classes in a typical objc application is small,
the warning/attribute combination allows the trade off that by annotating the
root classes (case a) with the attribute, which should be a minor effort, we
can warn about the programmer errors (case b).