* [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function
@ 2018-04-22 22:02 dave.pagan
2018-05-24 8:07 ` [PING][PATCH] " dave.pagan
2018-05-30 23:11 ` [PATCH] " Jeff Law
0 siblings, 2 replies; 6+ messages in thread
From: dave.pagan @ 2018-04-22 22:02 UTC (permalink / raw)
To: Gcc Patch List
[-- Attachment #1: Type: text/plain, Size: 656 bytes --]
This patch fixes handling of -Werror=return-type as well as
-Wno-return-type. Currently, -Werror=return-type does not turn the
warnings into errors and -Wno-return-type does not turn off
warning/error. Now they both work as expected.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55976
Initialize warn_return_type only for C++/C++ with ObjC extensions. In C,
this allows us to differentiate between default (no option), or cases
where -Wreturn-type/-Wno-return-type are specified. Elsewhere, update
references to warn_return_type (for C) to reflect change in initialization.
Patch was successfully bootstrapped and tested on x86_64-linux.
--Dave
[-- Attachment #2: CL-55976 --]
[-- Type: text/plain, Size: 700 bytes --]
/c
2018-04-22 David Pagan <dave.pagan@oracle.com>
PR c/55976
* c-decl.c (grokdeclarator): Update check for return type warnings.
(start_function): Likewise.
(finish_function): Likewise.
* c-typeck.c (c_finish_return): Update check for return type warnings.
Pass OPT_Wreturn_type to pedwarn when appropriate.
* c-opts.c (c_common_post_options): Set default for warn_return_type
for C++/C++ with ObjC extensions only. For C, makes it possible to
differentiate between default (no option), -Wreturn-type, and
-Wno-return-type.
/testsuite
2018-04-22 David Pagan <dave.pagan@oracle.com>
PR c/55976
* gcc.dg/noncompile/pr55976-1.c: New test.
* gcc.dg/noncompile/pr55976-2.c: New test.
[-- Attachment #3: PATCH-55976 --]
[-- Type: text/plain, Size: 4357 bytes --]
Index: gcc/c/c-decl.c
===================================================================
--- gcc/c/c-decl.c (revision 259017)
+++ gcc/c/c-decl.c (working copy)
@@ -5745,7 +5745,7 @@ grokdeclarator (const struct c_declarator *declara
/* Issue a warning if this is an ISO C 99 program or if
-Wreturn-type and this is a function, or if -Wimplicit;
prefer the former warning since it is more explicit. */
- if ((warn_implicit_int || warn_return_type || flag_isoc99)
+ if ((warn_implicit_int || warn_return_type > 0 || flag_isoc99)
&& funcdef_flag)
warn_about_return_type = 1;
else
@@ -8739,7 +8739,7 @@ start_function (struct c_declspecs *declspecs, str
if (warn_about_return_type)
warn_defaults_to (loc, flag_isoc99 ? OPT_Wimplicit_int
- : (warn_return_type ? OPT_Wreturn_type
+ : (warn_return_type > 0 ? OPT_Wreturn_type
: OPT_Wimplicit_int),
"return type defaults to %<int%>");
@@ -9450,8 +9450,9 @@ finish_function (void)
finish_fname_decls ();
- /* Complain if there's just no return statement. */
- if (warn_return_type
+ /* Complain if there's no return statement only if option specified on
+ command line. */
+ if (warn_return_type > 0
&& TREE_CODE (TREE_TYPE (TREE_TYPE (fndecl))) != VOID_TYPE
&& !current_function_returns_value && !current_function_returns_null
/* Don't complain if we are no-return. */
Index: gcc/c/c-typeck.c
===================================================================
--- gcc/c/c-typeck.c (revision 259017)
+++ gcc/c/c-typeck.c (working copy)
@@ -10129,13 +10129,13 @@ c_finish_return (location_t loc, tree retval, tree
if (!retval)
{
current_function_returns_null = 1;
- if ((warn_return_type || flag_isoc99)
+ if ((warn_return_type >= 0 || flag_isoc99)
&& valtype != NULL_TREE && TREE_CODE (valtype) != VOID_TYPE)
{
bool warned_here;
if (flag_isoc99)
warned_here = pedwarn
- (loc, 0,
+ (loc, warn_return_type >= 0 ? OPT_Wreturn_type : 0,
"%<return%> with no value, in function returning non-void");
else
warned_here = warning_at
@@ -10153,7 +10153,7 @@ c_finish_return (location_t loc, tree retval, tree
bool warned_here;
if (TREE_CODE (TREE_TYPE (retval)) != VOID_TYPE)
warned_here = pedwarn
- (xloc, 0,
+ (xloc, warn_return_type >= 0 ? OPT_Wreturn_type : 0,
"%<return%> with a value, in function returning void");
else
warned_here = pedwarn
Index: gcc/c-family/c-opts.c
===================================================================
--- gcc/c-family/c-opts.c (revision 259017)
+++ gcc/c-family/c-opts.c (working copy)
@@ -994,8 +994,9 @@ c_common_post_options (const char **pfilename)
flag_extern_tls_init = 1;
}
- if (warn_return_type == -1)
- warn_return_type = c_dialect_cxx ();
+ /* Enable by default only for C++ and C++ with ObjC extensions. */
+ if (warn_return_type == -1 && c_dialect_cxx ())
+ warn_return_type = 1;
if (num_in_fnames > 1)
error ("too many filenames given. Type %s --help for usage",
Index: gcc/testsuite/gcc.dg/noncompile/pr55976-1.c
===================================================================
--- gcc/testsuite/gcc.dg/noncompile/pr55976-1.c (revision 0)
+++ gcc/testsuite/gcc.dg/noncompile/pr55976-1.c (working copy)
@@ -0,0 +1,14 @@
+/* PR c/55976 */
+/* { dg-do compile } */
+/* { dg-options "-Werror=return-type" } */
+
+/* Verify warnings for return type become errors. */
+
+void t () { return 1; } /* { dg-error "return" "function returning void" } */
+int b () { return; } /* { dg-error "return" "function returning non-void" } */
+
+int main()
+{
+ t(); b();
+ return 0;
+}
Index: gcc/testsuite/gcc.dg/noncompile/pr55976-2.c
===================================================================
--- gcc/testsuite/gcc.dg/noncompile/pr55976-2.c (revision 0)
+++ gcc/testsuite/gcc.dg/noncompile/pr55976-2.c (working copy)
@@ -0,0 +1,16 @@
+/* PR c/55976 */
+/* { dg-do compile } */
+/* { dg-options "-Wno-return-type" } */
+
+/* Verify that -Wno-return-type turns off warnings about function return
+ type. */
+
+void t () { return 1; } /* normally generates function returning void */
+int b () { return; } /* normally generates function returning non-void */
+
+int main()
+{
+ t (); b ();
+ return 0;
+}
+
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PING][PATCH] c/55976 -Werror=return-type should error on returning a value from a void function
2018-04-22 22:02 [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function dave.pagan
@ 2018-05-24 8:07 ` dave.pagan
2018-05-30 23:11 ` [PATCH] " Jeff Law
1 sibling, 0 replies; 6+ messages in thread
From: dave.pagan @ 2018-05-24 8:07 UTC (permalink / raw)
To: Gcc Patch List; +Cc: Jeff Law
Ping for the following C patch sent on 4/22/2018
https://gcc.gnu.org/ml/gcc-patches/2018-04/msg01034.html
Thanks,
--Dave
==========
On 04/22/2018 12:17 PM, dave.pagan@oracle.com wrote:
> This patch fixes handling of -Werror=return-type as well as
> -Wno-return-type. Currently, -Werror=return-type does not turn the
> warnings into errors and -Wno-return-type does not turn off
> warning/error. Now they both work as expected.
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55976
>
> Initialize warn_return_type only for C++/C++ with ObjC extensions. In
> C, this allows us to differentiate between default (no option), or
> cases where -Wreturn-type/-Wno-return-type are specified. Elsewhere,
> update references to warn_return_type (for C) to reflect change in
> initialization.
>
> Patch was successfully bootstrapped and tested on x86_64-linux.
>
> --Dave
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function
2018-04-22 22:02 [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function dave.pagan
2018-05-24 8:07 ` [PING][PATCH] " dave.pagan
@ 2018-05-30 23:11 ` Jeff Law
2018-05-31 13:14 ` H.J. Lu
1 sibling, 1 reply; 6+ messages in thread
From: Jeff Law @ 2018-05-30 23:11 UTC (permalink / raw)
To: dave.pagan, Gcc Patch List
On 04/22/2018 01:17 PM, dave.pagan@oracle.com wrote:
> This patch fixes handling of -Werror=return-type as well as
> -Wno-return-type. Currently, -Werror=return-type does not turn the
> warnings into errors and -Wno-return-type does not turn off
> warning/error. Now they both work as expected.
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55976
>
> Initialize warn_return_type only for C++/C++ with ObjC extensions. In C,
> this allows us to differentiate between default (no option), or cases
> where -Wreturn-type/-Wno-return-type are specified. Elsewhere, update
> references to warn_return_type (for C) to reflect change in initialization.
>
> Patch was successfully bootstrapped and tested on x86_64-linux.
>
> --Dave
>
>
> CL-55976
>
>
> /c
> 2018-04-22 David Pagan <dave.pagan@oracle.com>
>
> PR c/55976
> * c-decl.c (grokdeclarator): Update check for return type warnings.
> (start_function): Likewise.
> (finish_function): Likewise.
> * c-typeck.c (c_finish_return): Update check for return type warnings.
> Pass OPT_Wreturn_type to pedwarn when appropriate.
> * c-opts.c (c_common_post_options): Set default for warn_return_type
> for C++/C++ with ObjC extensions only. For C, makes it possible to
> differentiate between default (no option), -Wreturn-type, and
> -Wno-return-type.
>
> /testsuite
> 2018-04-22 David Pagan <dave.pagan@oracle.com>
>
> PR c/55976
> * gcc.dg/noncompile/pr55976-1.c: New test.
> * gcc.dg/noncompile/pr55976-2.c: New test.
THanks. Installed on the trunk.
Sorry for the long delay,
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function
2018-05-30 23:11 ` [PATCH] " Jeff Law
@ 2018-05-31 13:14 ` H.J. Lu
2018-06-01 21:09 ` dave.pagan
0 siblings, 1 reply; 6+ messages in thread
From: H.J. Lu @ 2018-05-31 13:14 UTC (permalink / raw)
To: Jeff Law; +Cc: dave.pagan, Gcc Patch List
On Wed, May 30, 2018 at 3:56 PM, Jeff Law <law@redhat.com> wrote:
> On 04/22/2018 01:17 PM, dave.pagan@oracle.com wrote:
>> This patch fixes handling of -Werror=return-type as well as
>> -Wno-return-type. Currently, -Werror=return-type does not turn the
>> warnings into errors and -Wno-return-type does not turn off
>> warning/error. Now they both work as expected.
>>
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55976
>>
>> Initialize warn_return_type only for C++/C++ with ObjC extensions. In C,
>> this allows us to differentiate between default (no option), or cases
>> where -Wreturn-type/-Wno-return-type are specified. Elsewhere, update
>> references to warn_return_type (for C) to reflect change in initialization.
>>
>> Patch was successfully bootstrapped and tested on x86_64-linux.
>>
>> --Dave
>>
>>
>> CL-55976
>>
>>
>> /c
>> 2018-04-22 David Pagan <dave.pagan@oracle.com>
>>
>> PR c/55976
>> * c-decl.c (grokdeclarator): Update check for return type warnings.
>> (start_function): Likewise.
>> (finish_function): Likewise.
>> * c-typeck.c (c_finish_return): Update check for return type warnings.
>> Pass OPT_Wreturn_type to pedwarn when appropriate.
>> * c-opts.c (c_common_post_options): Set default for warn_return_type
>> for C++/C++ with ObjC extensions only. For C, makes it possible to
>> differentiate between default (no option), -Wreturn-type, and
>> -Wno-return-type.
>>
>> /testsuite
>> 2018-04-22 David Pagan <dave.pagan@oracle.com>
>>
>> PR c/55976
>> * gcc.dg/noncompile/pr55976-1.c: New test.
>> * gcc.dg/noncompile/pr55976-2.c: New test.
> THanks. Installed on the trunk.
>
On x86, I got
FAIL: gcc.dg/noncompile/pr55976-1.c -O0 (test for excess errors)
FAIL: gcc.dg/noncompile/pr55976-1.c -O1 (test for excess errors)
FAIL: gcc.dg/noncompile/pr55976-1.c -O2 -flto -fno-use-linker-plugin
-flto-partition=none (test for excess errors)
FAIL: gcc.dg/noncompile/pr55976-1.c -O2 -flto -fuse-linker-plugin
-fno-fat-lto-objects (test for excess errors)
FAIL: gcc.dg/noncompile/pr55976-1.c -O2 (test for excess errors)
FAIL: gcc.dg/noncompile/pr55976-1.c -O3 -g (test for excess errors)
FAIL: gcc.dg/noncompile/pr55976-1.c -Os (test for excess errors)
[hjl@gnu-skx-1 testsuite]$
/export/ssd/git/gcc-test-native/bld/gcc/xgcc
-B/export/ssd/git/gcc-test-native/bld/gcc/
/export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c
-mx32 -B/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/
-B/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/mpxrt
-L/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/mpxrt/.libs
-B/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/
-B/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/mpxwrap
-L/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/mpxwrap/.libs
-fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -flto
-fuse-linker-plugin -fno-fat-lto-objects -Werror=return-type -S -o
pr55976-1.s
/export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:
In function \u2018t\u2019:
/export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:7:20:
error: \u2018return\u2019 with a value, in function returning void
[-Werror=return-type]
/export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:7:6:
note: declared here
/export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:
In function \u2018b\u2019:
/export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:8:12:
error: \u2018return\u2019 with no value, in function returning
non-void [-Werror=return-type]
/export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:8:5:
note: declared here
cc1: some warnings being treated as errors
[hjl@gnu-skx-1 testsuite]$
--
H.J.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function
2018-05-31 13:14 ` H.J. Lu
@ 2018-06-01 21:09 ` dave.pagan
2018-06-07 11:19 ` Martin Liška
0 siblings, 1 reply; 6+ messages in thread
From: dave.pagan @ 2018-06-01 21:09 UTC (permalink / raw)
To: H.J. Lu; +Cc: Gcc Patch List
Thanks for pointing this out. I'll check out what's going on and fix the
issue
--Dave
On 05/31/2018 05:53 AM, H.J. Lu wrote:
> On Wed, May 30, 2018 at 3:56 PM, Jeff Law <law@redhat.com> wrote:
>> On 04/22/2018 01:17 PM, dave.pagan@oracle.com wrote:
>>> This patch fixes handling of -Werror=return-type as well as
>>> -Wno-return-type. Currently, -Werror=return-type does not turn the
>>> warnings into errors and -Wno-return-type does not turn off
>>> warning/error. Now they both work as expected.
>>>
>>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55976
>>>
>>> Initialize warn_return_type only for C++/C++ with ObjC extensions. In C,
>>> this allows us to differentiate between default (no option), or cases
>>> where -Wreturn-type/-Wno-return-type are specified. Elsewhere, update
>>> references to warn_return_type (for C) to reflect change in initialization.
>>>
>>> Patch was successfully bootstrapped and tested on x86_64-linux.
>>>
>>> --Dave
>>>
>>>
>>> CL-55976
>>>
>>>
>>> /c
>>> 2018-04-22 David Pagan <dave.pagan@oracle.com>
>>>
>>> PR c/55976
>>> * c-decl.c (grokdeclarator): Update check for return type warnings.
>>> (start_function): Likewise.
>>> (finish_function): Likewise.
>>> * c-typeck.c (c_finish_return): Update check for return type warnings.
>>> Pass OPT_Wreturn_type to pedwarn when appropriate.
>>> * c-opts.c (c_common_post_options): Set default for warn_return_type
>>> for C++/C++ with ObjC extensions only. For C, makes it possible to
>>> differentiate between default (no option), -Wreturn-type, and
>>> -Wno-return-type.
>>>
>>> /testsuite
>>> 2018-04-22 David Pagan <dave.pagan@oracle.com>
>>>
>>> PR c/55976
>>> * gcc.dg/noncompile/pr55976-1.c: New test.
>>> * gcc.dg/noncompile/pr55976-2.c: New test.
>> THanks. Installed on the trunk.
>>
> On x86, I got
>
> FAIL: gcc.dg/noncompile/pr55976-1.c -O0 (test for excess errors)
> FAIL: gcc.dg/noncompile/pr55976-1.c -O1 (test for excess errors)
> FAIL: gcc.dg/noncompile/pr55976-1.c -O2 -flto -fno-use-linker-plugin
> -flto-partition=none (test for excess errors)
> FAIL: gcc.dg/noncompile/pr55976-1.c -O2 -flto -fuse-linker-plugin
> -fno-fat-lto-objects (test for excess errors)
> FAIL: gcc.dg/noncompile/pr55976-1.c -O2 (test for excess errors)
> FAIL: gcc.dg/noncompile/pr55976-1.c -O3 -g (test for excess errors)
> FAIL: gcc.dg/noncompile/pr55976-1.c -Os (test for excess errors)
>
> [hjl@gnu-skx-1 testsuite]$
> /export/ssd/git/gcc-test-native/bld/gcc/xgcc
> -B/export/ssd/git/gcc-test-native/bld/gcc/
> /export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c
> -mx32 -B/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/
> -B/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/mpxrt
> -L/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/mpxrt/.libs
> -B/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/
> -B/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/mpxwrap
> -L/export/ssd/git/gcc-test-native/bld/x86_64-pc-linux-gnu/32/libmpx/mpxwrap/.libs
> -fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -flto
> -fuse-linker-plugin -fno-fat-lto-objects -Werror=return-type -S -o
> pr55976-1.s
> /export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:
> In function \u2018t\u2019:
> /export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:7:20:
> error: \u2018return\u2019 with a value, in function returning void
> [-Werror=return-type]
> /export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:7:6:
> note: declared here
> /export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:
> In function \u2018b\u2019:
> /export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:8:12:
> error: \u2018return\u2019 with no value, in function returning
> non-void [-Werror=return-type]
> /export/ssd/git/gcc-test-native/src-trunk/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:8:5:
> note: declared here
> cc1: some warnings being treated as errors
> [hjl@gnu-skx-1 testsuite]$
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function
2018-06-01 21:09 ` dave.pagan
@ 2018-06-07 11:19 ` Martin Liška
0 siblings, 0 replies; 6+ messages in thread
From: Martin Liška @ 2018-06-07 11:19 UTC (permalink / raw)
To: dave.pagan, H.J. Lu; +Cc: Gcc Patch List
On 06/01/2018 11:08 PM, dave.pagan@oracle.com wrote:
> Thanks for pointing this out. I'll check out what's going on and fix the issue
>
> --Dave
Hi.
Difference is in between C and C++ FEs:
marxin@marxinbox:/dev/shm/objdir/gcc> ./xgcc -B. /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c: In function âtâ:
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:7:20: warning: âreturnâ with a value, in function returning void
void t () { return 1; } /* { dg-error "return" "function returning void" } */
^
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:7:6: note: declared here
void t () { return 1; } /* { dg-error "return" "function returning void" } */
^
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c: In function âbâ:
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:8:12: warning: âreturnâ with no value, in function returning non-void
int b () { return; } /* { dg-error "return" "function returning non-void" } */
^~~~~~
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:8:5: note: declared here
int b () { return; } /* { dg-error "return" "function returning non-void" } */
^
marxin@marxinbox:/dev/shm/objdir/gcc> ./xg++ -B. /home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c: In function âvoid t()â:
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:7:20: error: return-statement with a value, in function returning âvoidâ [-fpermissive]
void t () { return 1; } /* { dg-error "return" "function returning void" } */
^
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c: In function âint b()â:
/home/marxin/Programming/gcc/gcc/testsuite/gcc.dg/noncompile/pr55976-1.c:8:12: error: return-statement with no value, in function returning âintâ [-fpermissive]
int b () { return; } /* { dg-error "return" "function returning non-void" } */
^~~~~~
Martin
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-06-07 11:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-22 22:02 [PATCH] c/55976 -Werror=return-type should error on returning a value from a void function dave.pagan
2018-05-24 8:07 ` [PING][PATCH] " dave.pagan
2018-05-30 23:11 ` [PATCH] " Jeff Law
2018-05-31 13:14 ` H.J. Lu
2018-06-01 21:09 ` dave.pagan
2018-06-07 11:19 ` Martin Liška
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).