Is there a way to turn off specific compiler warnings?
The particular warning that gets in the way of the more helpful ones is:
warning: missing string capacity - assuming 255
Yang Lao wrote:
Is there a way to turn off specific compiler warnings?
In general
{$local W-} DoSomethingPotentiallyDangerous; {$endlocal}
or on the command-line -Wno-xxx (e.g. -Wno-cast-align)
The particular warning that gets in the way of the more helpful ones is:
warning: missing string capacity - assuming 255
but I don't know of an xxx for this particular warning.
Regards,
Adriaan van Os
I could not find an -Wno-xxx that applies to just that one warning. Wonder how involved it would it be to create one, rather than change a myriad files.
PS: Sorry for replying above the quoted text but gmail tends to muddle my responses if I reply below the quoted text (as on Thu, Jun 12, 2008 at 8:13 AM). Thereby everyone could easily ignore my response. ;)
On Mon, Dec 22, 2008 at 12:12 AM, Adriaan van Os gpc@microbizz.nl wrote:
Yang Lao wrote:
Is there a way to turn off specific compiler warnings?
In general
{$local W-} DoSomethingPotentiallyDangerous; {$endlocal}
or on the command-line -Wno-xxx (e.g. -Wno-cast-align)
The particular warning that gets in the way of the more helpful ones is:
warning: missing string capacity - assuming 255
but I don't know of an xxx for this particular warning.
Regards,
Adriaan van Os
Yang Lao wrote:
I could not find an -Wno-xxx that applies to just that one warning. Wonder how involved it would it be to create one, rather than change a myriad files.
Relatively easy.
PS: Sorry for replying above the quoted text but gmail tends to muddle my responses if I reply below the quoted text (as on Thu, Jun 12, 2008 at 8:13 AM). Thereby everyone could easily ignore my response. ;)
I have never seen that behaviour in gmail.
Regards,
Adriaan van Os
Adriaan van Os wrote:
Yang Lao wrote:
Is there a way to turn off specific compiler warnings?
In general
{$local W-} DoSomethingPotentiallyDangerous; {$endlocal}
or on the command-line -Wno-xxx (e.g. -Wno-cast-align)
The particular warning that gets in the way of the more helpful ones is:
warning: missing string capacity - assuming 255
but I don't know of an xxx for this particular warning.
There is none. It could be added, but I see no real point is doing so, since it's easy to work around: Just define a string type, e.g.:
type MyString = String (255);
and use it for your variables and value parameters.
This "work-around" has additional advantages, e.g. it's then easy to change the capacity when needed (255 is an arbitrary limit, and it's quite likely the real limit you'd want is either smaller or larger than that), and for other compilers (or perhaps future GPC versions which might have an unlimited string type), the definition of just this one type needs to be adjusted.
In fact, the "GPC" module defines "TString" as "String (2048)", so if you use it, you could use TString (as some of GPC's own units do).
Frank