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