https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79210
Bug ID: 79210 Summary: "internal compiler error: in get_substring_ranges_for_loc" processing -Wformat-signedness warning Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: preprocessor Assignee: unassigned at gcc dot gnu.org Reporter: arnd at linaro dot org Target Milestone: --- I ran into a variant of pr78569, again building the kernel, reduced test case of drivers/scsi/lpfc/lpfc_attr.c: /* build with gcc-7.0.0 -c test.c -Wformat -Wformat-signedness */ __attribute__((format(printf, 3, 4))) void dev_printk(const char *level, void *dev, const char *fmt, ...); #define lpfc_vport_param_init(attr) \ void lpfc_##attr##_init(void *vport, unsigned int val) \ { \ dev_printk("3", (void *)0, \ "0423 lpfc_"#attr" attribute cannot be set to %d, "\ "allowed range is [0, 1]\n", val); \ } #define LPFC_VPORT_ATTR_R(name, desc) \ unsigned int lpfc_##name;\ lpfc_vport_param_init(name)\ LPFC_VPORT_ATTR_R(peer_port_login, "Allow peer ports on the same physical port to login to each " "other."); // EOF /git/arm-soc/drivers/scsi/lpfc/lpfc_attr.c: In function 'lpfc_peer_port_login_init': /git/arm-soc/drivers/scsi/lpfc/lpfc_attr.c:16:1: internal compiler error: in get_substring_ranges_for_loc, at input.c:1398 LPFC_VPORT_ATTR_R(peer_port_login, ^~~~~~~~~~~~~~~~~ 0x111138c get_substring_ranges_for_loc /home/arnd/git/gcc/gcc/input.c:1398 0x111138c get_source_location_for_substring(cpp_reader*, string_concat_db*, unsigned int, cpp_ttype, int, int, int, unsigned int*) /home/arnd/git/gcc/gcc/input.c:1468 0x672afe c_get_substring_location(substring_loc const&, unsigned int*) /home/arnd/git/gcc/gcc/c-family/c-common.c:865 0x69ea5e get_corrected_substring /home/arnd/git/gcc/gcc/c-family/c-format.c:3308 0x69ea5e format_type_warning /home/arnd/git/gcc/gcc/c-family/c-format.c:3461 0x6a01f7 check_format_types /home/arnd/git/gcc/gcc/c-family/c-format.c:3075 0x6a01f7 argument_parser::check_argument_type(format_char_info const*, length_modifier const&, tree_node*&, char const*&, bool, unsigned long&, tree_node*&, int, char const*, char const*, unsigned int, char) /home/arnd/git/gcc/gcc/c-family/c-format.c:2675 0x6a2d07 argument_parser::check_argument_type(format_char_info const*, length_modifier const&, tree_node*&, char const*&, bool, unsigned long&, tree_node*&, int, char const*, char const*, unsigned int, char) /home/arnd/git/gcc/gcc/c-family/c-format.c:2568 0x6a2d07 check_format_info_main /home/arnd/git/gcc/gcc/c-family/c-format.c:2813 0x6a2d07 check_format_arg /home/arnd/git/gcc/gcc/c-family/c-format.c:1672 0x6a0e5e check_format_info /home/arnd/git/gcc/gcc/c-family/c-format.c:1405 0x6a0e5e check_function_format(tree_node*, int, tree_node**) /home/arnd/git/gcc/gcc/c-family/c-format.c:1066 0x695712 check_function_arguments(unsigned int, tree_node const*, int, tree_node**) /home/arnd/git/gcc/gcc/c-family/c-common.c:5599 0x638e8b build_function_call_vec(unsigned int, vec<unsigned int, va_heap, vl_ptr>, tree_node*, vec<tree_node*, va_gc, vl_embed>*, vec<tree_node*, va_gc, vl_embed>*) /home/arnd/git/gcc/gcc/c/c-typeck.c:3113 0x6556d7 c_parser_postfix_expression_after_primary /home/arnd/git/gcc/gcc/c/c-parser.c:8402 0x64e4ea c_parser_postfix_expression /home/arnd/git/gcc/gcc/c/c-parser.c:8194 0x65105a c_parser_unary_expression /home/arnd/git/gcc/gcc/c/c-parser.c:7012 0x651daf c_parser_cast_expression /home/arnd/git/gcc/gcc/c/c-parser.c:6841 0x651ff5 c_parser_binary_expression /home/arnd/git/gcc/gcc/c/c-parser.c:6650 0x652c88 c_parser_conditional_expression /home/arnd/git/gcc/gcc/c/c-parser.c:6418