On Wed, Jan 06, 2016 at 03:02:05PM -0500, David Malcolm wrote: > On Mon, 2015-12-21 at 22:20 +0100, Jakub Jelinek wrote: > > On Mon, Dec 21, 2015 at 02:10:17PM -0700, Jeff Law wrote: > > > On 12/18/2015 01:21 PM, David Malcolm wrote: > > > > > > >I don't think there's a way to fix -Wmisleading-indentation if we're > > > >in this state, so the first part of the following patch detects if > > > >this has happened, and effectively turns off -Wmisleading-indentation > > > >from that point onwards. To avoid a false sense of security, the > > > >patch issues a "sorry" at the that point, currently with this wording: > > > >location-overflow-test-1.c:17:0: sorry, unimplemented: > > > >-Wmisleading-indentation is disabled from this point onwards, since > > > >column-tracking was disabled due to the size of the code/headers > > > Seems reasonable. I can't see any way to get indentation warnings if we > > > don't have column info. > > > > sorry will set sorrycount to non-zero though, so seen_error () will be true > > and the compiler will exit with non-zero exit status. That is IMHO not > > appripriate for warning (at least unless -Werror=misleading-indentation). > > Some possibilities here: > > (A, the patch): issue a "sorry" to indicate that the warning isn't > available anymore, leading to a nonzero exit status > > (B) silently disable the warning > > (C) issue a "warning" about the impaired warning, using > OPT_Wmisleading_indentation, so that it becomes an error if > -Werror=misleading-indentation. > > (D) something else? > > Do you have a preference as to what approach I should try? I think I > like option (C) above.
My preference would be inform (). That is e.g. what var-tracking uses in a similar case: if (MAY_HAVE_DEBUG_INSNS) inform (DECL_SOURCE_LOCATION (cfun->decl), "variable tracking size limit exceeded with " "-fvar-tracking-assignments, retrying without"); else inform (DECL_SOURCE_LOCATION (cfun->decl), "variable tracking size limit exceeded"); when the tables are too large and computing good quality debug info would be too expensive. Jakub