[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Removing comment induces compiler error

From: Greg Chicares
Subject: Re: [lmi] Removing comment induces compiler error
Date: Wed, 8 Mar 2017 01:18:29 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0

On 2017-03-06 03:04, Vadim Zeitlin wrote:
> On Mon, 6 Mar 2017 02:47:52 +0000 Greg Chicares <address@hidden> wrote:
> [...my proposal to use a pragma to disable warning in the code using wx...]
> GC> No, thanks. This method does have its advantages, but:
> GC> In this case, correctness would depend on a pragma.
>  No, it wouldn't, why? The code is exactly the same, it's just the warning
> that is suppressed.

Oh. You're right. I just had trouble perceiving that twenty-five pages
of error messages could arise from a too-strict warning with '-Werror'.

> GC> We should have fewer pragmas, not more.
>  I don't see any rationale for this dogma (well, yes, it's an oxymoron).
> Different pragmas are very different and some of them probably should be
> avoided, but this one ("GCC diagnostic") is definitely useful. Frankly, I
> don't see any reason for this pragmaphobia.

Many years ago, I started adding pragmata for another compiler, for
various purposes, and they proliferated beyond reason. In this case,
however, your strategy of writing a small set of push-warn-pop in
the lmi header that (by explicit design) all wx-dependent code must
include prevents such proliferation. And it would be nice to reap
an unanticipated dividend from all that PCH work. Thus:

On 2017-03-06 00:45, Vadim Zeitlin wrote:
|  There are several possible solutions, but I think the most robust one
| could be to disable this warning with a compiler pragma in pchfile_wx.hpp
| and get rid of wx_dependent_objects in the makefiles entirely. This would
| keep things at the code, rather than the makefile, level which is IMO
| preferable and would rely on a convention we already use ("all files using
| wx must include pchfile_wx.hpp") instead of using heuristics.
|  If you agree with this solution, please let me know if you'd like me to
| make (and test) the simple implementing it.

Great idea--yes please!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]