Sort.
[cparser] / main.c
diff --git a/main.c b/main.c
index 45ca3c8..7d679f6 100644 (file)
--- a/main.c
+++ b/main.c
@@ -80,7 +80,7 @@
 #include "warning.h"
 
 #ifndef PREPROCESSOR
-#define PREPROCESSOR "cpp -std=c99 -U__WCHAR_TYPE__ -D__WCHAR_TYPE__=int -U__SIZE_TYPE__ -D__SIZE_TYPE__=__SIZE_TYPE__ -m32"
+#define PREPROCESSOR "cpp -std=c99 -U__WCHAR_TYPE__ -D__WCHAR_TYPE__=int -U__SIZE_TYPE__ -D__SIZE_TYPE__=__SIZE_TYPE__ -m32 -U__STRICT_ANSI__"
 #endif
 
 #ifndef LINKER
@@ -628,6 +628,7 @@ int main(int argc, char **argv)
                                                || strcmp(opt, "unroll-loops") == 0
                                                || strcmp(opt, "expensive-optimizations") == 0
                                                || strcmp(opt, "no-common") == 0
+                                               || strcmp(opt, "PIC") == 0
                                                || strncmp(opt, "align-loops=", sizeof("align-loops=")-1) == 0
                                                || strncmp(opt, "align-jumps=", sizeof("align-jumps=")-1) == 0
                                                || strncmp(opt, "align-functions=", sizeof("align-functions=")-1) == 0) {
@@ -662,7 +663,7 @@ int main(int argc, char **argv)
                                {
                                        const char *opt;
                                        GET_ARG_AFTER(opt, "-Wl,");
-                                       add_flag(&ldflags_obst, "%s", opt);
+                                       add_flag(&ldflags_obst, "-Wl,%s", opt);
                                }
                                else set_warning_opt(&option[1]);
                        } else if(option[0] == 'm') {
@@ -738,7 +739,8 @@ int main(int argc, char **argv)
                        } else if(strcmp(option, "pg") == 0) {
                                set_be_option("gprof");
                                add_flag(&ldflags_obst, "-pg");
-                       } else if(strcmp(option, "pedantic") == 0) {
+                       } else if(strcmp(option, "pedantic") == 0
+                                       || strcmp(option, "ansi") == 0) {
                                fprintf(stderr, "warning: ignoring gcc option '%s'\n", arg);
                        } else if(strcmp(option, "shared") == 0) {
                                add_flag(&ldflags_obst, "-shared");
@@ -992,7 +994,7 @@ int main(int argc, char **argv)
                        if (in == preprocessed_in) {
                                int pp_result = pclose(preprocessed_in);
                                if (pp_result != EXIT_SUCCESS) {
-                                       return pp_result;
+                                       exit(EXIT_FAILURE);
                                }
                        }