|
From: | Paul Eggert |
Subject: | Re: 'const' function attribute |
Date: | Wed, 14 Oct 2020 07:57:10 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 10/13/20 6:24 PM, Bruno Haible wrote:
To me, this is a pointless warning. Would you agree that a bug report to the GCC people makes sense?
Yes and no. Theoretically, it makes sense that 'const' could apply to static functions too. However the practical argument is weak. Programmers shouldn't be bothering with 'const' on static functions, since the compiler should figure it out. And with extern functions, 'const' would mean the API requires that the function is a no-op, which is a pretty small niche case.
[Prev in Thread] | Current Thread | [Next in Thread] |