aaron.ballman added inline comments.
Comment at: test/Sema/builtin-dump-struct.c:8
+ void *b;
+ int (*goodfunc)(const char *, ...);
+ int (*badfunc1)(const char *);
> aaron.ballman wrote:
> > paulsemel wrote:
> > > aaron.ballman wrote:
> > > > Can you also add a test for: `int (*badfunc4)(char *, ...);` and `int
> > > > (*badfunc5)();`
> > > Isn't `int (*func)()` is a valid prototype for a printf like function in
> > > C ?
> > > I instead added `int (*func)(void)` to the test cases.
> > > Isn't int (*func)() is a valid prototype for a printf like function in C ?
> > No, because it's missing the `const char *` as the mandatory first
> > parameter. Do you want that to be allowed and hope the callee has it
> > correct on their side, or do you want it to diagnose as not being a valid
> > function?
> Actually, from a kernel developer perspective, I would say it's better to let
> the user do its stuff on his side, because kernel is full of trick !
> But if you think I'd rather check whether we have `int (*)(const char *,
> ...)` at any time, we can go for it !
Okay, if you think it'd be beneficial to allow a function without a prototype,
I'm okay with it. Can you make it an explicit "good" test case?
cfe-commits mailing list