aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpperror.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2000-03-31 23:16:11 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-03-31 23:16:11 +0000
commitae79697b721b607964d32468c87d1881c3a39974 (patch)
treec407bb10c858c1ee81576f79ea01d3e9c8890316 /gcc/cpperror.c
parent7bde2862db58ec0828e26fc95768f6d008a97f6f (diff)
downloadgcc-ae79697b721b607964d32468c87d1881c3a39974.zip
gcc-ae79697b721b607964d32468c87d1881c3a39974.tar.gz
gcc-ae79697b721b607964d32468c87d1881c3a39974.tar.bz2
cpplib.h: Merge struct cpp_options into struct cpp_reader.
* cpplib.h: Merge struct cpp_options into struct cpp_reader. Reorder struct cpp_options and struct cpp_reader for better packing. Replace CPP_OPTIONS macro with CPP_OPTION which takes two args. Change all 'char' flags to 'unsigned char'. Move show_column flag into struct cpp_options. Don't prototype cpp_options_init. * cpphash.h, cpperror.c, cppexp.c, cppfiles.c, cpphash.c, cppinit.c, cpplex.c, cpplib.c: Replace CPP_OPTIONS (pfile)->whatever with CPP_OPTION (pfile, whatever), and likewise for opts = CPP_OPTIONS (pfile); ... opts->whatever; * cppinit.c (merge_include_chains): Take a cpp_reader *. Extract CPP_OPTION (pfile, pending) and work with that directly. (cpp_options_init): Delete. (cpp_reader_init): Turn on on-by-default options here. Allocate the pending structure here. (cl_options, enum opt_code): Define these from the same table, kept in a large macro. Add -fshow-column and -fno-show-column options. * cpperror.c (v_message): If show_column is off, don't print the column number. * cppmain.c: Update for new interface. * fix-header.c: Likewise. From-SVN: r32850
Diffstat (limited to 'gcc/cpperror.c')
-rw-r--r--gcc/cpperror.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index bbb29ed..0da2c57 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -121,7 +121,8 @@ v_message (pfile, is_error, file, line, col, msg, ap)
cpp_buf_line_and_col (ip, &line, &col);
print_containing_files (pfile, ip);
- print_file_and_line (file, line, col);
+ print_file_and_line (file, line,
+ CPP_OPTION (pfile, show_column) ? col : 0);
}
else
fprintf (stderr, "%s: ", progname);
@@ -217,7 +218,7 @@ cpp_error VPARAMS ((cpp_reader * pfile, const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- if (CPP_OPTIONS (pfile)->inhibit_errors)
+ if (CPP_OPTION (pfile, inhibit_errors))
return;
v_message (pfile, 1, NULL, -1, -1, msgid, ap);
@@ -245,7 +246,7 @@ cpp_error_with_line VPARAMS ((cpp_reader *pfile, int line, int column,
msgid = va_arg (ap, const char *);
#endif
- if (CPP_OPTIONS (pfile)->inhibit_errors)
+ if (CPP_OPTION (pfile, inhibit_errors))
return;
v_message (pfile, 1, NULL, line, column, msgid, ap);
@@ -277,7 +278,7 @@ cpp_warning VPARAMS ((cpp_reader * pfile, const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- if (CPP_OPTIONS (pfile)->inhibit_warnings)
+ if (CPP_OPTION (pfile, inhibit_warnings))
return;
v_message (pfile, 0, NULL, -1, -1, msgid, ap);
@@ -305,7 +306,7 @@ cpp_warning_with_line VPARAMS ((cpp_reader * pfile, int line, int column,
msgid = va_arg (ap, const char *);
#endif
- if (CPP_OPTIONS (pfile)->inhibit_warnings)
+ if (CPP_OPTION (pfile, inhibit_warnings))
return;
v_message (pfile, 0, NULL, line, column, msgid, ap);
@@ -328,12 +329,12 @@ cpp_pedwarn VPARAMS ((cpp_reader * pfile, const char *msgid, ...))
msgid = va_arg (ap, const char *);
#endif
- if (CPP_OPTIONS (pfile)->pedantic_errors
- ? CPP_OPTIONS (pfile)->inhibit_errors
- : CPP_OPTIONS (pfile)->inhibit_warnings)
+ if (CPP_OPTION (pfile, pedantic_errors)
+ ? CPP_OPTION (pfile, inhibit_errors)
+ : CPP_OPTION (pfile, inhibit_warnings))
return;
- v_message (pfile, CPP_OPTIONS (pfile)->pedantic_errors,
+ v_message (pfile, CPP_OPTION (pfile, pedantic_errors),
NULL, -1, -1, msgid, ap);
va_end(ap);
}
@@ -359,12 +360,12 @@ cpp_pedwarn_with_line VPARAMS ((cpp_reader * pfile, int line, int column,
msgid = va_arg (ap, const char *);
#endif
- if (CPP_OPTIONS (pfile)->pedantic_errors
- ? CPP_OPTIONS (pfile)->inhibit_errors
- : CPP_OPTIONS (pfile)->inhibit_warnings)
+ if (CPP_OPTION (pfile, pedantic_errors)
+ ? CPP_OPTION (pfile, inhibit_errors)
+ : CPP_OPTION (pfile, inhibit_warnings))
return;
- v_message (pfile, CPP_OPTIONS (pfile)->pedantic_errors,
+ v_message (pfile, CPP_OPTION (pfile, pedantic_errors),
NULL, line, column, msgid, ap);
va_end(ap);
}
@@ -396,12 +397,12 @@ cpp_pedwarn_with_file_and_line VPARAMS ((cpp_reader *pfile,
msgid = va_arg (ap, const char *);
#endif
- if (CPP_OPTIONS (pfile)->pedantic_errors
- ? CPP_OPTIONS (pfile)->inhibit_errors
- : CPP_OPTIONS (pfile)->inhibit_warnings)
+ if (CPP_OPTION (pfile, pedantic_errors)
+ ? CPP_OPTION (pfile, inhibit_errors)
+ : CPP_OPTION (pfile, inhibit_warnings))
return;
- v_message (pfile, CPP_OPTIONS (pfile)->pedantic_errors,
+ v_message (pfile, CPP_OPTION (pfile, pedantic_errors),
file, line, col, msgid, ap);
va_end(ap);
}