Author
anonymous
over 6 years ago
Language
C
Compiler
gcc 8.2.0
Options
Warnings
C99
-pedantic
Author
anonymous
over 6 years ago
$ gcc prog.c -Wall -Wextra -std=c99 -pedantic
prog.c: In function 'swapNodes':
prog.c:15:14: warning: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
strcpy(temp->value, a->value);
~~~~^~~~~~~
In file included from prog.c:2:
/usr/include/string.h:125:14: note: expected 'char * restrict' but argument is of type 'char **'
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c:15:24: warning: passing argument 2 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
strcpy(temp->value, a->value);
~^~~~~~~
In file included from prog.c:2:
/usr/include/string.h:125:14: note: expected 'const char * restrict' but argument is of type 'char **'
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c:20:11: warning: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
strcpy(a->value, b->value);
~^~~~~~~
In file included from prog.c:2:
/usr/include/string.h:125:14: note: expected 'char * restrict' but argument is of type 'char **'
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c:20:21: warning: passing argument 2 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
strcpy(a->value, b->value);
~^~~~~~~
In file included from prog.c:2:
/usr/include/string.h:125:14: note: expected 'const char * restrict' but argument is of type 'char **'
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c:24:11: warning: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
strcpy(b->value, temp->value);
~^~~~~~~
In file included from prog.c:2:
/usr/include/string.h:125:14: note: expected 'char * restrict' but argument is of type 'char **'
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c:24:24: warning: passing argument 2 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
strcpy(b->value, temp->value);
~~~~^~~~~~~
In file included from prog.c:2:
/usr/include/string.h:125:14: note: expected 'const char * restrict' but argument is of type 'char **'
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c:12:29: warning: unused parameter 'list' [-Wunused-parameter]
void swapNodes(struct node *list, struct node *a, struct node *b, int len) {
~~~~~~~~~~~~~^~~~
prog.c:12:71: warning: unused parameter 'len' [-Wunused-parameter]
void swapNodes(struct node *list, struct node *a, struct node *b, int len) {
~~~~^~~
prog.c: In function 'prependList':
prog.c:35:15: warning: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
strcpy(temp -> value, value);
~~~~~^~~~~~~~
In file included from prog.c:2:
/usr/include/string.h:125:14: note: expected 'char * restrict' but argument is of type 'char **'
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c: In function 'main':
prog.c:90:20: warning: passing argument 1 of 'strcat' from incompatible pointer type [-Wincompatible-pointer-types]
strcat(list->value, line);
~~~~^~~~~~~
In file included from prog.c:2:
/usr/include/string.h:133:14: note: expected 'char * restrict' but argument is of type 'char **'
extern char *strcat (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c:122:22: warning: passing argument 2 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
strcpy(f, front->value);
~~~~~^~~~~~~
In file included from prog.c:2:
/usr/include/string.h:125:14: note: expected 'const char * restrict' but argument is of type 'char **'
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c:126:21: warning: passing argument 2 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types]
strcpy(b, back->value);
~~~~^~~~~~~
In file included from prog.c:2:
/usr/include/string.h:125:14: note: expected 'const char * restrict' but argument is of type 'char **'
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
^~~~~~
prog.c:143:12: warning: assignment to 'char *' from incompatible pointer type 'char **' [-Wincompatible-pointer-types]
holder = list->value;
^
prog.c:144:23: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
for (int j = 0; j < strlen(holder); ++j) {
^
prog.c: In function 'prependList':
prog.c:41:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
prog.exe: malloc.c:3722: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
Signal:
Aborted