Hello,
I may have hit a bug while using libcurl, a common library for network
operations, on gcc 8.3.0.
Building this program
#include
int
main (void)
{
float a;
curl_easy_setopt (NULL, 0, (void *) a);
}
with "gcc -c bug.c" gives
bug.c: In function ‘main’:
bug.c
This program
#include
int main ()
{
char *s;
isspace (s);
}
compiles with no warning in gcc 8.3.0, even though there's a type
mistake; the correct call would be isspace (*s).
The ctype functions are implemented as macros in glibc, so you can't
have type checking. But they ar
> Try -Wsystem-headers.
You're right. That showed a warning.
> You need to suppress the macro to get the builtin.
That means a macro expansion takes precedence over a builtin function
substitution, if I understand correctly. It makes sense, because
preprocessing happens before compilati
This snippet that I wrote
struct
str
{
int val;
};
void
main (int argc, char **argv)
{
struct str **p;
int i;
i = p->val;
}
is obviously incorrect. But gcc 8.3.0 says
pointer.c: In function ‘main’:
pointer.c:14:8: error: ‘*p’ is a pointer; did you
In gcc 8.3.0, compiling
enum
test
{
FIRST = 1,
SECOND = 1,
THIRD = 2
};
int
main (void)
{
return 0;
}
generates no warning even with -Wextra. That hit me today, because I
had a large enum with many explicitly assigned constants and I
accidentally used the same value twice,