[Top][All Lists]

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

Re: [PATCH 1/2] mark functions with const and pure attributes

From: Paul Eggert
Subject: Re: [PATCH 1/2] mark functions with const and pure attributes
Date: Sun, 01 May 2011 11:03:38 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110223 Thunderbird/3.1.8

One other thing, and this is more important.  The declarations
should be marked.  For example, the declaration of argmatch
should be marked with _GL_ATTRIBUTE_PURE (or _GL_PURE)
in argmatch.h.  We mark functions partly so that callers
can be optimized better, but typically this works for
other compilation units only if the pure mark is in the .h file.

If the declaration in the .h file is marked, the definition
in the .c file need not be marked, though you may want to
do that anyway to help remind the reader that it's pure.

This affects Bruno's point that the lines all have enough room
for _GL_ATTRIBUTE_CONST etc.; I expect that point no longer holds
once declarations are marked.

reply via email to

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