This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/18071] [4.0/4.1/4.2/4.3 Regression] -Winline does not respect -fno-default-inline
- From: "manu at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Jan 2008 16:44:46 -0000
- Subject: [Bug middle-end/18071] [4.0/4.1/4.2/4.3 Regression] -Winline does not respect -fno-default-inline
- References: <bug-18071-4672@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #35 from manu at gcc dot gnu dot org 2008-01-15 16:44 -------
(In reply to comment #33)
> Yes, this is what I understand. I think we need a new flag specifying
> if in the source the 'inline' keyword was used and solely use that for
> inline warning purposes. (That is, I would not expect to get a warning
> for non-'inline' class methods either, regardless of -fdefault-inline
> setting).
>
Then, you would need more than a new flag. Currently the problem is to
distinguish
1) the explicit 'inline' keyword and the implicit inline keyword of
-fdefault-inline from 2) no inline whatsoever and no inline because of
-fno-default-inline
Currently:
explicit inline: DECL_DECLARED_INLINE
fdefault-inline : DECL_DECLARED_INLINE
fno-default-inline: DECL_DECLARED_INLINE
no inline:
(DECL_INLINE is an internal note that the function may be inlinable. Neither
explicit inline nor -fdefault-inline actually ensure that DECL_INLINE will be
always true).
Ideally:
explicit inline: DECL_DECLARED_INLINE && DECL_INLINE_LINKAGE
fdefault-inline : DECL_DECLARED_INLINE && DECL_INLINE_LINKAGE
fno-default-inline: DECL_INLINE_LINKAGE
no inline:
In your proposal we will need:
explicit inline: DECL_EXPLICITLY_DECLARED_INLINE && DECL_DECLARED_INLINE &&
DECL_INLINE_LINKAGE
fdefault-inline : DECL_DECLARED_INLINE && DECL_INLINE_LINKAGE
fno-default-inline: DECL_INLINE_LINKAGE
no inline:
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18071