On Tue, Jul 01, 2025 at 10:37:02AM +0200, Jean-Marc Lasgouttes wrote:
> Le 30/06/2025 à 23:40, Scott Kostyshak a écrit :
> > Clang gives the following warning:
> > 
> > src/frontends/qt/GuiAlert.cpp:55:33: warning: cast from 'const char *' to 
> > 'char *' drops const qualifier [-Wcast-qual]
> >     55 |         QApplication app(argc, (char**)argv);
> >        |                                        ^
> > 
> >  From what I can understand, the initial const was intended, and casting
> > away the const was intented (e.g., otherwise the code doesn't compile).
> > The relevant code was introduced at a7b921aeeba.
> > 
> > The attached patch just makes the cast explicit.
> > 
> > Is this OK?
> 
> I would propose the attached instead. Your patch turns a pointer to read
> only data ("lyx") to a pointer to rw data. This does not seem right. Here, I
> use a string to duplicate the string to a rw area. I am not sure that it is
> the simplest, but I find it readable at least.

Thanks, JMarc! Please commit. (and also thanks for the explanation).

Scott

Attachment: signature.asc
Description: PGP signature

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to