[cfe-dev] clang-modernize feature (was: Rename cpp11-migrate to be something more general?)
Dimitry Andric
dimitry at andric.com
Wed Sep 4 12:49:34 PDT 2013
On Sep 4, 2013, at 21:33, Richard <legalize at xmission.com> wrote:
> In article <CAJdarcHpLLjcXUgQzOpOQB0cuzTJQtehT+aggH_niAJFtRekQw at mail.gmail.com>,
> Eli Friedman <eli.friedman at gmail.com> writes:
>
>> On Tue, Sep 3, 2013 at 2:52 PM, Richard <legalize at xmission.com> wrote:
>>> My questions for this audience are:
>>>
>>> 1) is this considered a "modernizing" transform that is appropriate
>>> for clang-modernize?
>>>
>>
>> Maybe? Some people might consider it more of a style choice.
>
> It is my understanding that the syntax "(void)" is for compatibility
> with C, where (void) is needed to explicitly say that a function takes
> no arguments and () is the legacy syntax used by older C code before
> function prototypes.
In C, "(void)" in a prototype means "no arguments", while "()" means "no information about arguments". The latter is really only applicable to K&R-style code, so in a prototype it doesn't tell you anything about the arguments to the function. You would have to visit the actual definition to figure out which arguments the function has.
-Dimitry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130904/8e175f23/attachment.sig>
More information about the cfe-dev
mailing list