This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ Patch / RFC] PR 45385


I think the fix for 35602 was wrong; instead of trying to suppress the warning, we should avoid building expressions that trip it. In this case, the problem is a type mismatch in build_vec_init between maxindex/iterator (ptrdiff_type_node) and array_type_nelts_total (sizetype). And indeed, converting (ptrdiff_t)-1 to unsigned changes its sign.

I think a better fix for 35602 would be to bail out of build_vec_init exit early if maxindex is -1.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]