prog.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
include <stdio.h>
^
In file included from prog.c:2:0:
/usr/include/stdlib.h:139:8: error: unknown type name 'size_t'
extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
^
/usr/include/stdlib.h:466:22: error: unknown type name 'size_t'
extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
^
/usr/include/stdlib.h:468:22: error: unknown type name 'size_t'
extern void *calloc (size_t __nmemb, size_t __size)
^
/usr/include/stdlib.h:468:38: error: unknown type name 'size_t'
extern void *calloc (size_t __nmemb, size_t __size)
^
/usr/include/stdlib.h:480:36: error: unknown type name 'size_t'
extern void *realloc (void *__ptr, size_t __size)
^
/usr/include/stdlib.h:509:29: error: unknown type name 'size_t'
extern void *aligned_alloc (size_t __alignment, size_t __size)
^
/usr/include/stdlib.h:509:49: error: unknown type name 'size_t'
extern void *aligned_alloc (size_t __alignment, size_t __size)
^
/usr/include/stdlib.h:756:9: error: unknown type name 'size_t'
size_t __nmemb, size_t __size, __compar_fn_t __compar)
^
/usr/include/stdlib.h:756:25: error: unknown type name 'size_t'
size_t __nmemb, size_t __size, __compar_fn_t __compar)
^
In file included from /usr/include/stdlib.h:760:0,
from prog.c:2:
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:20:49: error: unknown type name 'size_t'
bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
^
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:20:65: error: unknown type name 'size_t'
bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
^
In file included from prog.c:2:0:
/usr/include/stdlib.h:765:34: error: unknown type name 'size_t'
extern void qsort (void *__base, size_t __nmemb, size_t __size,
^
/usr/include/stdlib.h:765:50: error: unknown type name 'size_t'
extern void qsort (void *__base, size_t __nmemb, size_t __size,
^
/usr/include/stdlib.h:863:36: error: unknown type name 'size_t'
extern int mblen (const char *__s, size_t __n) __THROW;
^
/usr/include/stdlib.h:867:34: error: unknown type name 'size_t'
const char *__restrict __s, size_t __n) __THROW;
^
/usr/include/stdlib.h:874:8: error: unknown type name 'size_t'
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
^
/usr/include/stdlib.h:875:32: error: unknown type name 'size_t'
const char *__restrict __s, size_t __n) __THROW;
^
/usr/include/stdlib.h:877:8: error: unknown type name 'size_t'
extern size_t wcstombs (char *__restrict __s,
^
/usr/include/stdlib.h:878:38: error: unknown type name 'size_t'
const wchar_t *__restrict __pwcs, size_t __n)
^
In file included from prog.c:3:0:
/usr/include/string.h:47:8: error: unknown type name 'size_t'
size_t __n) __THROW __nonnull ((1, 2));
^
/usr/include/string.h:50:56: error: unknown type name 'size_t'
extern void *memmove (void *__dest, const void *__src, size_t __n)
^
/usr/include/string.h:66:42: error: unknown type name 'size_t'
extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
^
/usr/include/string.h:69:56: error: unknown type name 'size_t'
extern int memcmp (const void *__s1, const void *__s2, size_t __n)
^
/usr/include/string.h:96:48: error: unknown type name 'size_t'
extern void *memchr (const void *__s, int __c, size_t __n)
^
/usr/include/string.h:133:39: error: unknown type name 'size_t'
const char *__restrict __src, size_t __n)
^
/usr/include/string.h:141:9: error: unknown type name 'size_t'
size_t __n) __THROW __nonnull ((1, 2));
^
/usr/include/string.h:147:57: error: unknown type name 'size_t'
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
^
/usr/include/string.h:154:8: error: unknown type name 'size_t'
extern size_t strxfrm (char *__restrict __dest,
^
/usr/include/string.h:155:40: error: unknown type name 'size_t'
const char *__restrict __src, size_t __n)
^
/usr/include/string.h:285:8: error: unknown type name 'size_t'
extern size_t strcspn (const char *__s, const char *__reject)
^
/usr/include/string.h:289:8: error: unknown type name 'size_t'
extern size_t strspn (const char *__s, const char *__accept)
^
/usr/include/string.h:399:8: error: unknown type name 'size_t'
extern size_t strlen (const char *__s)
^
/usr/include/string.h:451:33: error: unknown type name 'size_t'
extern void __bzero (void *__s, size_t __n) __THROW __nonnull ((1));
^
In file included from /usr/include/string.h:635:0,
from prog.c:3:
/usr/include/i386-linux-gnu/bits/string2.h:945:17: error: unknown type name 'size_t'
__STRING_INLINE size_t __strcspn_c1 (const char *__s, int __reject);
^
/usr/include/i386-linux-gnu/bits/string2.h:946:17: error: unknown type name 'size_t'
__STRING_INLINE size_t
^
/usr/include/i386-linux-gnu/bits/string2.h: In function '__strcspn_c1':
/usr/include/i386-linux-gnu/bits/string2.h:949:3: error: unknown type name 'size_t'
size_t __result = 0;
^
/usr/include/i386-linux-gnu/bits/string2.h: At top level:
/usr/include/i386-linux-gnu/bits/string2.h:955:17: error: unknown type name 'size_t'
__STRING_INLINE size_t __strcspn_c2 (const char *__s, int __reject1,
^
/usr/include/i386-linux-gnu/bits/string2.h:957:17: error: unknown type name 'size_t'
__STRING_INLINE size_t
^
/usr/include/i386-linux-gnu/bits/string2.h: In function '__strcspn_c2':
/usr/include/i386-linux-gnu/bits/string2.h:960:3: error: unknown type name 'size_t'
size_t __result = 0;
^
/usr/include/i386-linux-gnu/bits/string2.h: At top level:
/usr/include/i386-linux-gnu/bits/string2.h:967:17: error: unknown type name 'size_t'
__STRING_INLINE size_t __strcspn_c3 (const char *__s, int __reject1,
^
/usr/include/i386-linux-gnu/bits/string2.h:969:17: error: unknown type name 'size_t'
__STRING_INLINE size_t
^
/usr/include/i386-linux-gnu/bits/string2.h: In function '__strcspn_c3':
/usr/include/i386-linux-gnu/bits/string2.h:973:3: error: unknown type name 'size_t'
size_t __result = 0;
^
/usr/include/i386-linux-gnu/bits/string2.h: At top level:
/usr/include/i386-linux-gnu/bits/string2.h:1021:17: error: unknown type name 'size_t'
__STRING_INLINE size_t __strspn_c1 (const char *__s, int __accept);
^
/usr/include/i386-linux-gnu/bits/string2.h:1022:17: error: unknown type name 'size_t'
__STRING_INLINE size_t
^
/usr/include/i386-linux-gnu/bits/string2.h: In function '__strspn_c1':
/usr/include/i386-linux-gnu/bits/string2.h:1025:3: error: unknown type name 'size_t'
size_t __result = 0;
^
/usr/include/i386-linux-gnu/bits/string2.h: At top level:
/usr/include/i386-linux-gnu/bits/string2.h:1032:17: error: unknown type name 'size_t'
__STRING_INLINE size_t __strspn_c2 (const char *__s, int __accept1,
^
/usr/include/i386-linux-gnu/bits/string2.h:1034:17: error: unknown type name 'size_t'
__STRING_INLINE size_t
^
/usr/include/i386-linux-gnu/bits/string2.h: In function '__strspn_c2':
/usr/include/i386-linux-gnu/bits/string2.h:1037:3: error: unknown type name 'size_t'
size_t __result = 0;
^
/usr/include/i386-linux-gnu/bits/string2.h: At top level:
/usr/include/i386-linux-gnu/bits/string2.h:1044:17: error: unknown type name 'size_t'
__STRING_INLINE size_t __strspn_c3 (const char *__s, int __accept1,
^
/usr/include/i386-linux-gnu/bits/string2.h:1046:17: error: unknown type name 'size_t'
__STRING_INLINE size_t
^
/usr/include/i386-linux-gnu/bits/string2.h: In function '__strspn_c3':
/usr/include/i386-linux-gnu/bits/string2.h:1049:3: error: unknown type name 'size_t'
size_t __result = 0;
^
/usr/include/i386-linux-gnu/bits/string2.h: In function '__strpbrk_c2':
/usr/include/i386-linux-gnu/bits/string2.h:1105:42: error: 'size_t' undeclared (first use in this function)
return *__s == '\0' ? NULL : (char *) (size_t) __s;
^
/usr/include/i386-linux-gnu/bits/string2.h:1105:42: note: each undeclared identifier is reported only once for each function it appears in
/usr/include/i386-linux-gnu/bits/string2.h:1105:50: error: expected ';' before '__s'
return *__s == '\0' ? NULL : (char *) (size_t) __s;
^
/usr/include/i386-linux-gnu/bits/string2.h: In function '__strpbrk_c3':
/usr/include/i386-linux-gnu/bits/string2.h:1117:42: error: 'size_t' undeclared (first use in this function)
return *__s == '\0' ? NULL : (char *) (size_t) __s;
^
/usr/include/i386-linux-gnu/bits/string2.h:1117:50: error: expected ';' before '__s'
return *__s == '\0' ? NULL : (char *) (size_t) __s;
^
prog.c: In function 'main':
prog.c:11:2: error: unknown type name 'FILE'
FILE *filename;
^
prog.c:19:9: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
file = malloc(file_size * sizeof(*file));
^
prog.c:19:9: warning: incompatible implicit declaration of built-in function 'malloc'
prog.c:19:9: note: include '<stdlib.h>' or provide a declaration of 'malloc'
prog.c:23:3: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
printf("Enter filename: ");
^
prog.c:23:3: warning: incompatible implicit declaration of built-in function 'printf'
prog.c:23:3: note: include '<stdio.h>' or provide a declaration of 'printf'
prog.c:24:16: warning: implicit declaration of function 'getchar' [-Wimplicit-function-declaration]
while ((ch = getchar()) != '\n') {
^
prog.c:27:12: warning: implicit declaration of function 'realloc' [-Wimplicit-function-declaration]
file = realloc(file, file_size * sizeof(*file));
^
prog.c:27:12: warning: incompatible implicit declaration of built-in function 'realloc'
prog.c:27:12: note: include '<stdlib.h>' or provide a declaration of 'realloc'
prog.c:33:14: warning: implicit declaration of function 'fopen' [-Wimplicit-function-declaration]
filename = fopen(file, "r");
^
prog.c:33:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
filename = fopen(file, "r");
^
prog.c:35:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
filename = fopen(argv[1], "r");
^
prog.c:45:16: warning: implicit declaration of function 'getc' [-Wimplicit-function-declaration]
while ((ch = getc(filename)) != EOF) {
^
prog.c:45:35: error: 'EOF' undeclared (first use in this function)
while ((ch = getc(filename)) != EOF) {
^
prog.c:49:15: warning: incompatible implicit declaration of built-in function 'realloc'
buffer = realloc(buffer, str_size * sizeof(*buffer));
^
prog.c:49:15: note: include '<stdlib.h>' or provide a declaration of 'realloc'
prog.c:60:14: warning: incompatible implicit declaration of built-in function 'realloc'
names = realloc(names, name_size * sizeof(*names));
^
prog.c:60:14: note: include '<stdlib.h>' or provide a declaration of 'realloc'
prog.c:76:3: warning: implicit declaration of function 'fprintf' [-Wimplicit-function-declaration]
fprintf(stderr, "Error reading from file!\n");
^
prog.c:76:3: warning: incompatible implicit declaration of built-in function 'fprintf'
prog.c:76:3: note: include '<stdio.h>' or provide a declaration of 'fprintf'
prog.c:76:11: error: 'stderr' undeclared (first use in this function)
fprintf(stderr, "Error reading from file!\n");
^
prog.c:80:2: warning: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
qsort(names, name_count, sizeof(*names), string_cmp);
^
prog.c:83:3: warning: incompatible implicit declaration of built-in function 'printf'
printf("%s\n", names[i]);
^
prog.c:83:3: note: include '<stdio.h>' or provide a declaration of 'printf'
In file included from /usr/include/string.h:635:0,
from prog.c:3:
prog.c: In function 'string_cmp':
prog.c:96:9: error: unknown type name 'size_t'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: 'size_t' undeclared (first use in this function)
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c:96:9: error: expected expression before 'const'
return strcmp(*(char**)x1, *(char**)x2);
^
prog.c: In function 'exit_if_null':
prog.c:102:9: warning: incompatible implicit declaration of built-in function 'printf'
printf("Unexpected null pointer: %s\n", msg);
^
prog.c:102:9: note: include '<stdio.h>' or provide a declaration of 'printf'
prog.c: In function 'string_cmp':
prog.c:97:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^