bug-make
[Top][All Lists]
Advanced

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

RE: Invalid use of const pointer?


From: Joe Filion
Subject: RE: Invalid use of const pointer?
Date: Sun, 9 Jan 2022 20:02:29 -0500

 

Regarding: “This Thanks mostly goes to Joe Filion who initally noticed this.”

 

Your welcome.

 

If interested, I found another similar construct in another area of the code. Don’t worry, this appears to be the last one.

 

On line 557 of implicit.c:

 

                  p = strchr (nptr, '%');

 

nptr is a const pointer, but p is used as a non-const pointer later on and modifies the string.

 

Joe

 

Sent from Mail for Windows

 

From: Henrik Carlqvist
Sent: Sunday, January 9, 2022 5:06 AM
To: psmith@gnu.org
Cc: joefilion4@gmail.com; bug-make@gnu.org
Subject: Re: Invalid use of const pointer?

 

On Sat, 08 Jan 2022 17:29:33 -0500

Paul Smith <psmith@gnu.org> wrote:

> It turns out to be innocuous because none of the callers care that the

> value of the input string is modified if we return a different string,

> but it's still wrong and should be fixed.

 

If so, the easy and more correct fix might be to to remove const from the

function variable declarations rather than to restore the value.

 

> Thanks for noticing!

 

This Thanks mostly goes to Joe Filion who initally noticed this.

 

Best regards Henrik

 


reply via email to

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