aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 8376e1c..79fff2b 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -327,6 +327,9 @@ struct cpp_options
traditional C. */
unsigned char warn_traditional;
+ /* Nonzero means warn about long long numeric constants. */
+ unsigned char warn_long_long;
+
/* Nonzero means warn about text after an #endif (or #else). */
unsigned char warn_endif_labels;
@@ -577,6 +580,51 @@ extern cpp_buffer *cpp_push_buffer PARAMS ((cpp_reader *,
int, int));
extern int cpp_defined PARAMS ((cpp_reader *, const unsigned char *, int));
+/* A preprocessing number. Code assumes that any unused high bits of
+ the double integer are set to zero. */
+typedef unsigned HOST_WIDE_INT cpp_num_part;
+typedef struct cpp_num cpp_num;
+struct cpp_num
+{
+ cpp_num_part high;
+ cpp_num_part low;
+ bool unsignedp; /* True if value should be treated as unsigned. */
+ bool overflow; /* True if the most recent calculation overflowed. */
+};
+
+/* cpplib provides two interfaces for interpretation of preprocessing
+ numbers.
+
+ cpp_classify_number categorizes numeric constants according to
+ their field (integer, floating point, or invalid), radix (decimal,
+ octal, hexadecimal), and type suffixes. */
+
+#define CPP_N_CATEGORY 0x000F
+#define CPP_N_INVALID 0x0000
+#define CPP_N_INTEGER 0x0001
+#define CPP_N_FLOATING 0x0002
+
+#define CPP_N_WIDTH 0x00F0
+#define CPP_N_SMALL 0x0010 /* int, float. */
+#define CPP_N_MEDIUM 0x0020 /* long, double. */
+#define CPP_N_LARGE 0x0040 /* long long, long double. */
+
+#define CPP_N_RADIX 0x0F00
+#define CPP_N_DECIMAL 0x0100
+#define CPP_N_HEX 0x0200
+#define CPP_N_OCTAL 0x0400
+
+#define CPP_N_UNSIGNED 0x1000 /* Properties. */
+#define CPP_N_IMAGINARY 0x2000
+
+/* Classify a CPP_NUMBER token. The return value is a combination of
+ the flags from the above sets. */
+extern unsigned cpp_classify_number PARAMS ((cpp_reader *, const cpp_token *));
+
+/* Evaluate a token classified as category CPP_N_INTEGER. */
+extern cpp_num cpp_interpret_integer PARAMS ((cpp_reader *, const cpp_token *,
+ unsigned int type));
+
/* Diagnostic levels. To get a dianostic without associating a
position in the translation unit with it, use cpp_error_with_line
with a line number of zero. */