[PATCH] [RFC] PR20146 - Cannot return void with qualifiers

Zach Davis zdavkeos at gmail.com
Thu Jul 3 12:08:01 PDT 2014


As reported in bug 20146, a function cannot have a return type of
'void' with qualifiers.

Clang does emit a warning that the qualifiers are ignored
[-Wignored-qualifiers] (off by default), but according to [1] this
code is non-conforming.

The attached patch makes Clang issue a more specific warning like so:

    test3.c:8:18: warning: return type of void cannot be qualified
'volatile void'
    volatile void baz(void) { return; }
                  ^

[1] http://www.open-std.org/jtc1/sc22/wg14/docs/rr/dr_113.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20146_return_qual_void.patch
Type: text/x-patch
Size: 1454 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140703/d3336745/attachment.bin>


More information about the cfe-commits mailing list