c/9049: No support for selective enabling/disabling of warnings
gonz@ratloop.com
gonz@ratloop.com
Mon Dec 23 16:26:00 GMT 2002
>Number: 9049
>Category: c
>Synopsis: No support for selective enabling/disabling of warnings
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Dec 23 16:26:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Pete Gonzalez
>Release: 3.2.1
>Organization:
>Environment:
Debian Linux
>Description:
GCC provides no facility for disabling/enabling a warning for a single function or block of code. Every other C/C++ compiler has this feature. Examples:
Visual C++: #pragma warning
Borland C++: #pragma warn
Watcom C++: #pragma warning
Here is some sample syntax in Visual C++:
int a;
#pragma warning( disable : 4705 ) // diable warning
void func() {
a;
}
#pragma warning( default : 4705 ) // restore original setting
GCC has no such feature, requiring warnings to be disabled globally for an entire file (or project).
>How-To-Repeat:
N/A
>Fix:
Implement the "warning" pragma. Or, provide GCC attributes for disabling/enabling warnings.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list