Bug 14510 - AIX build with xlc fails because of fallthrough statements.
Summary: AIX build with xlc fails because of fallthrough statements.
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: 4.12.7
Hardware: PPC AIX
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-09-23 08:23 UTC by Ayappan
Modified: 2020-09-24 15:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ayappan 2020-09-23 08:23:47 UTC
There is a build issue (syntax error) while compiling Samba 4.12.7 with xlc compiler.
The syntax error points to the FALLTHROUGH statements.

Take pampass.c for example.,


  +166                                          udp->PAM_password);
  +167                                  /* PAM frees resp */
  +168                                  break;
  +169
  +170                          case PAM_TEXT_INFO:
  +171                                  FALL_THROUGH;
  +172
  +173                          case PAM_ERROR_MSG:
  +174                                  /* ignore it... */


According to online gcc docs, the FALL_THROUGH attribute should be used after a preceding statement. 
https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html

But surprisingly gcc compiles even though there is no preceding statement but not xlc compiler.
Comment 1 Douglas Bagnall 2020-09-23 21:23:03 UTC
(In reply to Ayappan from comment #0)

In this case I think FALL_THROUGH is unnecessary, and the normal thing would be to write it like this:


  +166                                          udp->PAM_password);
  +167                                  /* PAM frees resp */
  +168                                  break;
  +169
  +170                          case PAM_TEXT_INFO:
  +171                          case PAM_ERROR_MSG:
  +172                                  /* ignore it... */
Comment 2 Ayappan 2020-09-24 15:03:40 UTC
(In reply to Douglas Bagnall from comment #1)
Do we get a patch from the community ?