pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: inline functions with gnu99


From: Ben Pfaff
Subject: Re: inline functions with gnu99
Date: Sun, 23 Mar 2008 14:35:38 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

John Darrington <address@hidden> writes:

> I've just upgraded gcc, and now I'm getting these annoying warnings:
>
> lib/gtksheet/gsheet-hetero-column.c:231: warning: C99 inline functions
> are not supported; using GNU89
> lib/gtksheet/gsheet-hetero-column.c:231: warning: to disable this
> warning use -fgnu89-inline or the gnu_inline function attribute

The function in question is defined as:

    inline void
    g_sheet_hetero_column_set_width (GSheetHeteroColumn *geo, glong i, gint 
size)

and declared in the header file as:

    void g_sheet_hetero_column_set_width (GSheetHeteroColumn *geo,
                                          glong i, gint size);

The trouble is the "inline" keyword.  GCC's customary
interpretation of "inline" clashes badly with the C99 definition
of "inline".  In fact, the only place where they have the same
meaning is when a function is defined as "static inline".  This
is why recent versions of GCC warn about other uses of inline:
the newest versions of GCC are switching from GCC's customary
interpretation to the C99 definition, and the GCC developers
don't want anyone to be caught off-guard by the changes.

In PSPP, we don't really need any inline functions other than
static inline functions.  The inline keyword isn't really helping
here, since the inline definition is not in the header file
anyhow, so I would suggest just dropping the "inline" keyword
from the definition.
-- 
Ben Pfaff 
http://benpfaff.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]