Skip to content

are these warnings expected? can they be fixed? #3

@kenyapcomau

Description

@kenyapcomau

Modified Makefile to remove -Werror so that warnings would not abort compilation. In particular I don't understand the warning note: here.

gcc version 7.4.1 20190905 [gcc-7-branch revision 275407]
on Linux x86_64 platform

$ make -k test
cc -std=gnu99 -Wall -Wextra -std=c99 -pedantic pt_test.c -o pt_test_switch
pt_test.c: In functionpt_loop_without_braces’:
pt_test.c:157:6: warning: suggest explicit braces to avoid ambiguouselse’ [-Wdangling-else]
   if (1)
      ^
In file included from pt_test.c:3:0:
pt_test.c: In functionpt_reentrant’:
pt.h:90:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
     (pt)->status = (stat);                                                     \
     ~~~~~~~~~~~~~^~~~~~~~
pt_test.c:11:3: note: in expansion of macropt_labelpt_label(pt, 1);
   ^~~~~~~~
pt.h:91:3: note: here
   case __LINE__:;                                                              \
   ^
pt_test.c:11:3: note: in expansion of macropt_labelpt_label(pt, 1);
   ^~~~~~~~
pt.h:90:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
     (pt)->status = (stat);                                                     \
     ~~~~~~~~~~~~~^~~~~~~~
pt_test.c:16:3: note: in expansion of macropt_labelpt_label(pt, 2);
   ^~~~~~~~
pt.h:91:3: note: here
   case __LINE__:;                                                              \
   ^
pt_test.c:16:3: note: in expansion of macropt_labelpt_label(pt, 2);
   ^~~~~~~~
pt_test.c: In functionpt_wait_ready’:
pt.h:90:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
     (pt)->status = (stat);                                                     \
     ~~~~~~~~~~~~~^~~~~~~~
pt.h:105:5: note: in expansion of macropt_labelpt_label(pt, PT_STATUS_BLOCKED);                                           \
     ^~~~~~~~
pt_test.c:67:3: note: in expansion of macropt_waitpt_wait(pt, ready);
   ^~~~~~~
pt.h:91:3: note: here
   case __LINE__:;                                                              \
   ^
pt.h:105:5: note: in expansion of macropt_labelpt_label(pt, PT_STATUS_BLOCKED);                                           \
     ^~~~~~~~
pt_test.c:67:3: note: in expansion of macropt_waitpt_wait(pt, ready);
   ^~~~~~~
pt_test.c: In functionpt_yielding’:
pt.h:90:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
     (pt)->status = (stat);                                                     \
     ~~~~~~~~~~~~~^~~~~~~~
pt.h:113:5: note: in expansion of macropt_labelpt_label(pt, PT_STATUS_YIELDED);                                           \
     ^~~~~~~~
pt_test.c:93:3: note: in expansion of macropt_yieldpt_yield(pt);
   ^~~~~~~~
pt.h:91:3: note: here
   case __LINE__:;                                                              \
   ^
pt.h:113:5: note: in expansion of macropt_labelpt_label(pt, PT_STATUS_YIELDED);                                           \
     ^~~~~~~~
pt_test.c:93:3: note: in expansion of macropt_yieldpt_yield(pt);
   ^~~~~~~~
cc -std=gnu99 -Wall -Wextra -DPT_USE_GOTO=1 pt_test.c -o pt_test_goto
pt_test.c: In functionpt_loop_without_braces’:
pt_test.c:157:6: warning: suggest explicit braces to avoid ambiguouselse’ [-Wdangling-else]
   if (1)
      ^
cc -std=gnu99 -Wall -Wextra -std=c99 -pedantic -DPT_USE_SETJMP=1 pt_test.c -o pt_test_setjmp
pt_test.c: In functionpt_loop_without_braces’:
pt_test.c:157:6: warning: suggest explicit braces to avoid ambiguouselse’ [-Wdangling-else]
   if (1)
      ^
./pt_test_switch
./pt_test_goto
./pt_test_setjmp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions