Closed tch69 closed 2 years ago
that's odd. which version of clang are you using ? i did the following test under ubuntu 20.04:
#ifndef __printflike
#if __GNUC__ >= 3
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#define __scanflike(fmtarg, firstvararg) \
__attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#else
#define __printflike(fmtarg, firstvararg) /* nothing */
#define __scanflike(fmtarg, firstvararg) /* nothing */
#endif
#endif
int mvprintw(int, int, const char *, ...) __printflike(3, 4);
int mvscanw(int, int, const char *, ...) __scanflike(3, 4);
int main() {
int x, y;
mvscanw(1,2,"foo %d %d", &x, &y);
return y;
}
# clang --version
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /root
# clang -c scanflike.c && echo success
success
#
the __scanflike macro is meant to declare the prototypes of scanf-like function with special gcc attributes seen in this test code so it can warn on code that uses the functions decorated with wrong arguments.
btw it appears the macro is unused in form.h now, so it could be removed from there, but the definition in curses.h should kick in just fine for the functions using there.
Here:
clang version 14.0.0
Target: x86_64-pc-linux-musl
Thread model: posix
InstalledDir: /usr/llvm/bin
Also, as I have just rediscovered how to use markdown, the full error messages are here now
Welp, I removed <curses.h>
and it compiled just fine, turned out errors showed up because nothing used those definitions
Hi. I'm building
tabs
from nbase using Clang, and got this error which seems to be related to this ncurses:A quick grep shows that function was defined in form.h, but adding it didn't solve the problem. And at you said in #46, there's a lot of mismatches growing between NetBSD's version and this version, maybe it caused the problem. What do I need to do make it work?