D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 22415 - importC: Deprecation: switch case fallthrough - use 'goto case;' if intended
Summary: importC: Deprecation: switch case fallthrough - use 'goto case;' if intended
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: diagnostic, ImportC, pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2021-10-17 22:44 UTC by Iain Buclaw
Modified: 2021-12-14 10:34 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2021-10-17 22:44:15 UTC
Deprecation warning is D-specific, and doesn't apply to C11 semantic rules.
---
int test(int a)
{
    switch (a)
    {
        case 0:
            a = 1;
        case 1:
            return a;
        case 2:
        default:
            return -1;
    }
}
Comment 1 Dlang Bot 2021-11-11 08:41:41 UTC
@WalterBright created dlang/dmd pull request #13283 "fix Issue 22415 - ImportC: Deprecation: switch case fallthrough - use…" fixing this issue:

- fix Issue 22415 - importC: Deprecation: switch case fallthrough - use 'goto case;' if intended

https://github.com/dlang/dmd/pull/13283
Comment 2 Dlang Bot 2021-11-11 12:20:09 UTC
dlang/dmd pull request #13283 "fix Issue 22415 - ImportC: Deprecation: switch case fallthrough - use…" was merged into master:

- c17799324a05bcd9c008788805857c12bf8ee5f9 by Walter Bright:
  fix Issue 22415 - importC: Deprecation: switch case fallthrough - use 'goto case;' if intended

https://github.com/dlang/dmd/pull/13283
Comment 3 Dlang Bot 2021-11-23 07:30:59 UTC
dlang/dmd pull request #13344 "[stable] importC: Backport master fixes to stable" was merged into stable:

- 5cbbd56942ed2b455aa09a0b9087b288621dead5 by Walter Bright:
  fix Issue 22415 - importC: Deprecation: switch case fallthrough - use 'goto case;' if intended

https://github.com/dlang/dmd/pull/13344
Comment 4 Dlang Bot 2021-12-14 10:34:17 UTC
dlang/dmd pull request #13421 "merge stable" was merged into master:

- 53f3dc76d5aff132c5ac2a9474330af70d17914e by Iain Buclaw:
  [stable] importC: Backport master fixes to stable (#13344)
  
  * fix Issue 22415 - importC: Deprecation: switch case fallthrough - use 'goto case;' if intended
  
  * ImportC: improve parsing error message
  
  Co-authored-by: Walter Bright <walter@walterbright.com>

https://github.com/dlang/dmd/pull/13421