https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114808

            Bug ID: 114808
           Summary: Qualified void return type is not diagnosed
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luigighiron at gmail dot com
  Target Milestone: ---

The following code is accepted in GCC with no diagnostics being produced (even
when using -pedantic-errors):

const void f(void){}

This code violates the following constraint:

> The return type of a function shall be void or a complete object type other
> than array type.
Section 6.9.1 "Function definitions" Paragraph 3 ISO/IEC 9899:2018

const void is not void and it is not a complete object type.

Reply via email to