comparison libcpp/include/cpplib.h @ 63:b7f97abdc517 gcc-4.6-20100522

update gcc from gcc-4.5.0 to gcc-4.6
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Mon, 24 May 2010 12:47:05 +0900
parents 77e2b8dfacca
children f6334be47118
comparison
equal deleted inserted replaced
56:3c8a44c06a95 63:b7f97abdc517
153 }; 153 };
154 #undef OP 154 #undef OP
155 #undef TK 155 #undef TK
156 156
157 /* C language kind, used when calling cpp_create_reader. */ 157 /* C language kind, used when calling cpp_create_reader. */
158 enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_STDC89, CLK_STDC94, CLK_STDC99, 158 enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_GNUC1X,
159 CLK_STDC89, CLK_STDC94, CLK_STDC99, CLK_STDC1X,
159 CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX0X, CLK_CXX0X, CLK_ASM}; 160 CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX0X, CLK_CXX0X, CLK_ASM};
160 161
161 /* Payload of a NUMBER, STRING, CHAR or COMMENT token. */ 162 /* Payload of a NUMBER, STRING, CHAR or COMMENT token. */
162 struct GTY(()) cpp_string { 163 struct GTY(()) cpp_string {
163 unsigned int len; 164 unsigned int len;
495 be expanded. */ 496 be expanded. */
496 cpp_hashnode * (*macro_to_expand) (cpp_reader *, const cpp_token *); 497 cpp_hashnode * (*macro_to_expand) (cpp_reader *, const cpp_token *);
497 498
498 /* Called to emit a diagnostic. This callback receives the 499 /* Called to emit a diagnostic. This callback receives the
499 translated message. */ 500 translated message. */
500 bool (*error) (cpp_reader *, int, source_location, unsigned int, 501 bool (*error) (cpp_reader *, int, int, source_location, unsigned int,
501 const char *, va_list *) 502 const char *, va_list *)
502 ATTRIBUTE_FPTR_PRINTF(5,0); 503 ATTRIBUTE_FPTR_PRINTF(6,0);
503 504
504 /* Callbacks for when a macro is expanded, or tested (whether 505 /* Callbacks for when a macro is expanded, or tested (whether
505 defined or not at the time) in #ifdef, #ifndef or "defined". */ 506 defined or not at the time) in #ifdef, #ifndef or "defined". */
506 void (*used_define) (cpp_reader *, unsigned int, cpp_hashnode *); 507 void (*used_define) (cpp_reader *, unsigned int, cpp_hashnode *);
507 void (*used_undef) (cpp_reader *, unsigned int, cpp_hashnode *); 508 void (*used_undef) (cpp_reader *, unsigned int, cpp_hashnode *);
827 828
828 /* Diagnostic levels. To get a diagnostic without associating a 829 /* Diagnostic levels. To get a diagnostic without associating a
829 position in the translation unit with it, use cpp_error_with_line 830 position in the translation unit with it, use cpp_error_with_line
830 with a line number of zero. */ 831 with a line number of zero. */
831 832
832 /* Warning, an error with -Werror. */ 833 enum {
833 #define CPP_DL_WARNING 0x00 834 /* Warning, an error with -Werror. */
834 /* Same as CPP_DL_WARNING, except it is not suppressed in system headers. */ 835 CPP_DL_WARNING = 0,
835 #define CPP_DL_WARNING_SYSHDR 0x01 836 /* Same as CPP_DL_WARNING, except it is not suppressed in system headers. */
836 /* Warning, an error with -pedantic-errors or -Werror. */ 837 CPP_DL_WARNING_SYSHDR,
837 #define CPP_DL_PEDWARN 0x02 838 /* Warning, an error with -pedantic-errors or -Werror. */
838 /* An error. */ 839 CPP_DL_PEDWARN,
839 #define CPP_DL_ERROR 0x03 840 /* An error. */
840 /* An internal consistency check failed. Prints "internal error: ", 841 CPP_DL_ERROR,
841 otherwise the same as CPP_DL_ERROR. */ 842 /* An internal consistency check failed. Prints "internal error: ",
842 #define CPP_DL_ICE 0x04 843 otherwise the same as CPP_DL_ERROR. */
843 /* An informative note following a warning. */ 844 CPP_DL_ICE,
844 #define CPP_DL_NOTE 0x05 845 /* An informative note following a warning. */
845 /* A fatal error. */ 846 CPP_DL_NOTE,
846 #define CPP_DL_FATAL 0x06 847 /* A fatal error. */
848 CPP_DL_FATAL
849 };
850
851 /* Warning reason codes. Use a reason code of zero for unclassified warnings
852 and errors that are not warnings. */
853 enum {
854 CPP_W_NONE = 0,
855 CPP_W_DEPRECATED,
856 CPP_W_COMMENTS,
857 CPP_W_MISSING_INCLUDE_DIRS,
858 CPP_W_TRIGRAPHS,
859 CPP_W_MULTICHAR,
860 CPP_W_TRADITIONAL,
861 CPP_W_LONG_LONG,
862 CPP_W_ENDIF_LABELS,
863 CPP_W_NUM_SIGN_CHANGE,
864 CPP_W_VARIADIC_MACROS,
865 CPP_W_BUILTIN_MACRO_REDEFINED,
866 CPP_W_DOLLARS,
867 CPP_W_UNDEF,
868 CPP_W_UNUSED_MACROS,
869 CPP_W_CXX_OPERATOR_NAMES,
870 CPP_W_NORMALIZE,
871 CPP_W_INVALID_PCH,
872 CPP_W_WARNING_DIRECTIVE
873 };
847 874
848 /* Output a diagnostic of some kind. */ 875 /* Output a diagnostic of some kind. */
849 extern bool cpp_error (cpp_reader *, int, const char *msgid, ...) 876 extern bool cpp_error (cpp_reader *, int, const char *msgid, ...)
850 ATTRIBUTE_PRINTF_3; 877 ATTRIBUTE_PRINTF_3;
878 extern bool cpp_warning (cpp_reader *, int, const char *msgid, ...)
879 ATTRIBUTE_PRINTF_3;
880 extern bool cpp_pedwarning (cpp_reader *, int, const char *msgid, ...)
881 ATTRIBUTE_PRINTF_3;
882 extern bool cpp_warning_syshdr (cpp_reader *, int, const char *msgid, ...)
883 ATTRIBUTE_PRINTF_3;
851 884
852 /* Output a diagnostic with "MSGID: " preceding the 885 /* Output a diagnostic with "MSGID: " preceding the
853 error string of errno. No location is printed. */ 886 error string of errno. No location is printed. */
854 extern bool cpp_errno (cpp_reader *, int, const char *msgid); 887 extern bool cpp_errno (cpp_reader *, int, const char *msgid);
855 888
856 /* Same as cpp_error, except additionally specifies a position as a 889 /* Same as cpp_error, except additionally specifies a position as a
857 (translation unit) physical line and physical column. If the line is 890 (translation unit) physical line and physical column. If the line is
858 zero, then no location is printed. */ 891 zero, then no location is printed. */
859 extern bool cpp_error_with_line (cpp_reader *, int, source_location, unsigned, 892 extern bool cpp_error_with_line (cpp_reader *, int, source_location,
860 const char *msgid, ...) ATTRIBUTE_PRINTF_5; 893 unsigned, const char *msgid, ...)
894 ATTRIBUTE_PRINTF_5;
895 extern bool cpp_warning_with_line (cpp_reader *, int, source_location,
896 unsigned, const char *msgid, ...)
897 ATTRIBUTE_PRINTF_5;
898 extern bool cpp_pedwarning_with_line (cpp_reader *, int, source_location,
899 unsigned, const char *msgid, ...)
900 ATTRIBUTE_PRINTF_5;
901 extern bool cpp_warning_with_line_syshdr (cpp_reader *, int, source_location,
902 unsigned, const char *msgid, ...)
903 ATTRIBUTE_PRINTF_5;
861 904
862 /* In lex.c */ 905 /* In lex.c */
863 extern int cpp_ideq (const cpp_token *, const char *); 906 extern int cpp_ideq (const cpp_token *, const char *);
864 extern void cpp_output_line (cpp_reader *, FILE *); 907 extern void cpp_output_line (cpp_reader *, FILE *);
865 extern unsigned char *cpp_output_line_to_string (cpp_reader *, 908 extern unsigned char *cpp_output_line_to_string (cpp_reader *,