c-common.c (37654) | c-common.c (38510) |
---|---|
1/* Subroutines shared by all languages that are variants of C. 2 Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. 3 4This file is part of GNU CC. 5 6GNU CC is free software; you can redistribute it and/or modify 7it under the terms of the GNU General Public License as published by 8the Free Software Foundation; either version 2, or (at your option) --- 699 unchanged lines hidden (view full) --- 708 /* Type of argument if length modifier `L' is used. 709 If NULL, then this modifier is not allowed. */ 710 tree *bigllen; 711 /* List of other modifier characters allowed with these options. */ 712 char *flag_chars; 713} format_char_info; 714 715static format_char_info print_char_table[] = { | 1/* Subroutines shared by all languages that are variants of C. 2 Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. 3 4This file is part of GNU CC. 5 6GNU CC is free software; you can redistribute it and/or modify 7it under the terms of the GNU General Public License as published by 8the Free Software Foundation; either version 2, or (at your option) --- 699 unchanged lines hidden (view full) --- 708 /* Type of argument if length modifier `L' is used. 709 If NULL, then this modifier is not allowed. */ 710 tree *bigllen; 711 /* List of other modifier characters allowed with these options. */ 712 char *flag_chars; 713} format_char_info; 714 715static format_char_info print_char_table[] = { |
716/* FreeBSD kernel extensions. */ 717 { "D", 1, T_C, NULL, NULL, NULL, NULL, "-wp" }, 718 { "b", 1, T_C, NULL, NULL, NULL, NULL, "-wp" }, 719 { "rz", 0, T_I, T_I, T_L, NULL, NULL, "-wp0 +#" }, 720#define unextended_print_char_table (print_char_table + 3) |
|
716 { "di", 0, T_I, T_I, T_L, T_LL, T_LL, "-wp0 +" }, 717 { "oxX", 0, T_UI, T_UI, T_UL, T_ULL, T_ULL, "-wp0#" }, 718 { "u", 0, T_UI, T_UI, T_UL, T_ULL, T_ULL, "-wp0" }, 719/* Two GNU extensions. */ 720 { "Z", 0, T_ST, NULL, NULL, NULL, NULL, "-wp0" }, 721 { "m", 0, T_V, NULL, NULL, NULL, NULL, "-wp" }, 722 { "feEgG", 0, T_D, NULL, NULL, NULL, T_LD, "-wp0 +#" }, 723 { "c", 0, T_I, NULL, T_W, NULL, NULL, "-w" }, --- 342 unchanged lines hidden (view full) --- 1066 if (params == 0) 1067 { 1068 warning (tfaff); 1069 return; 1070 } 1071 cur_param = TREE_VALUE (params); 1072 params = TREE_CHAIN (params); 1073 ++arg_num; | 721 { "di", 0, T_I, T_I, T_L, T_LL, T_LL, "-wp0 +" }, 722 { "oxX", 0, T_UI, T_UI, T_UL, T_ULL, T_ULL, "-wp0#" }, 723 { "u", 0, T_UI, T_UI, T_UL, T_ULL, T_ULL, "-wp0" }, 724/* Two GNU extensions. */ 725 { "Z", 0, T_ST, NULL, NULL, NULL, NULL, "-wp0" }, 726 { "m", 0, T_V, NULL, NULL, NULL, NULL, "-wp" }, 727 { "feEgG", 0, T_D, NULL, NULL, NULL, T_LD, "-wp0 +#" }, 728 { "c", 0, T_I, NULL, T_W, NULL, NULL, "-w" }, --- 342 unchanged lines hidden (view full) --- 1071 if (params == 0) 1072 { 1073 warning (tfaff); 1074 return; 1075 } 1076 cur_param = TREE_VALUE (params); 1077 params = TREE_CHAIN (params); 1078 ++arg_num; |
1079 /* XXX should we allow unsigned ints here? */ |
|
1074 if (TYPE_MAIN_VARIANT (TREE_TYPE (cur_param)) 1075 != integer_type_node) 1076 { 1077 sprintf (message, | 1080 if (TYPE_MAIN_VARIANT (TREE_TYPE (cur_param)) 1081 != integer_type_node) 1082 { 1083 sprintf (message, |
1078 "field width is not type int (arg %d)", | 1084 "precision is not type int (arg %d)", |
1079 arg_num); 1080 warning (message); 1081 } 1082 } 1083 } 1084 else 1085 { 1086 while (isdigit (*format_chars)) 1087 ++format_chars; 1088 } 1089 } 1090 } | 1085 arg_num); 1086 warning (message); 1087 } 1088 } 1089 } 1090 else 1091 { 1092 while (isdigit (*format_chars)) 1093 ++format_chars; 1094 } 1095 } 1096 } |
1097 if (*format_chars == 'b') 1098 { 1099 /* There should be an int arg to control the string arg. */ 1100 if (params == 0) 1101 { 1102 warning (tfaff); 1103 return; 1104 } 1105 if (info->first_arg_num != 0) 1106 { 1107 cur_param = TREE_VALUE (params); 1108 params = TREE_CHAIN (params); 1109 ++arg_num; 1110 if ((TYPE_MAIN_VARIANT (TREE_TYPE (cur_param)) 1111 != integer_type_node) 1112 && 1113 (TYPE_MAIN_VARIANT (TREE_TYPE (cur_param)) 1114 != unsigned_type_node)) 1115 { 1116 sprintf (message, "bitmap is not type int (arg %d)", 1117 arg_num); 1118 warning (message); 1119 } 1120 } 1121 } 1122 if (*format_chars == 'D') 1123 { 1124 /* There should be an unsigned char * arg before the string arg. */ 1125 if (params == 0) 1126 { 1127 warning (tfaff); 1128 return; 1129 } 1130 if (info->first_arg_num != 0) 1131 { 1132 cur_param = TREE_VALUE (params); 1133 params = TREE_CHAIN (params); 1134 ++arg_num; 1135 cur_type = TREE_TYPE (cur_param); 1136 if (TREE_CODE (cur_type) != POINTER_TYPE 1137 || TYPE_MAIN_VARIANT (TREE_TYPE (cur_type)) 1138 != unsigned_char_type_node) 1139 { 1140 sprintf (message, 1141 "ethernet address is not type unsigned char * (arg %d)", 1142 arg_num); 1143 warning (message); 1144 } 1145 } 1146 } |
|
1091 if (*format_chars == 'h' || *format_chars == 'l' || *format_chars == 'q' || 1092 *format_chars == 'L') 1093 length_char = *format_chars++; 1094 else 1095 length_char = 0; 1096 if (length_char == 'l' && *format_chars == 'l') 1097 length_char = 'q', format_chars++; 1098 aflag = 0; --- 11 unchanged lines hidden (view full) --- 1110 } 1111 format_char = *format_chars; 1112 if (format_char == 0) 1113 { 1114 warning ("conversion lacks type at end of format"); 1115 continue; 1116 } 1117 format_chars++; | 1147 if (*format_chars == 'h' || *format_chars == 'l' || *format_chars == 'q' || 1148 *format_chars == 'L') 1149 length_char = *format_chars++; 1150 else 1151 length_char = 0; 1152 if (length_char == 'l' && *format_chars == 'l') 1153 length_char = 'q', format_chars++; 1154 aflag = 0; --- 11 unchanged lines hidden (view full) --- 1166 } 1167 format_char = *format_chars; 1168 if (format_char == 0) 1169 { 1170 warning ("conversion lacks type at end of format"); 1171 continue; 1172 } 1173 format_chars++; |
1118 fci = info->is_scan ? scan_char_table : print_char_table; | 1174 fci = info->is_scan ? scan_char_table 1175 : flag_format_extensions ? print_char_table 1176 : unextended_print_char_table; |
1119 while (fci->format_chars != 0 1120 && index (fci->format_chars, format_char) == 0) 1121 ++fci; 1122 if (fci->format_chars == 0) 1123 { 1124 if (format_char >= 040 && format_char < 0177) 1125 sprintf (message, 1126 "unknown conversion type character `%c' in format", --- 1150 unchanged lines hidden --- | 1177 while (fci->format_chars != 0 1178 && index (fci->format_chars, format_char) == 0) 1179 ++fci; 1180 if (fci->format_chars == 0) 1181 { 1182 if (format_char >= 040 && format_char < 0177) 1183 sprintf (message, 1184 "unknown conversion type character `%c' in format", --- 1150 unchanged lines hidden --- |