-Wconversion
Ian Lance Taylor
ian@wasabisystems.com
Sat Apr 17 18:36:00 GMT 2004
Steven J Abner <tauvan@starpower.net> writes:
> I would like to use -Wconversion in building, however I've
> searched to find a way (like #pragma unused) to shut of the warning
> for a specific case.
> Example:
> warning: passing arg 2 of 'chmod' with different width due to prototype
> I'm satisfied that there is no problem, so for the function or the
> location or completed source file that uses 'chmod' I'd like to stop
> the warning, but use a blanket flag -Wconversion for any new code
> created within a project or that source file.
> Is this possible? or is what I'm asking defeating the purpose? Is
> there a directive that I can place at the head of the source file that
> can be removed if new code is added?
Use typecasts: chmod ("foo", (mode_t) x);
Ian
More information about the Gcc-help
mailing list