#include "MurmurHash2.h"
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
+
//-----------------------------------------------------------------------------
// Platform-specific functions and macros
name, prefix, input = sys.argv[1:]
print("""\
+%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
+#endif
+%}""")
+print("""\
struct {}_name {{ const char* name; int id; }};
%null-strings
%%""".format(name))
#define _weakref_(x) __attribute__((weakref(#x)))
#define _alignas_(x) __attribute__((aligned(__alignof(x))))
#define _cleanup_(x) __attribute__((cleanup(x)))
+#define _fallthrough_ __attribute__((fallthrough))
/* Temporarily disable some warnings */
#define DISABLE_WARNING_DECLARATION_AFTER_STATEMENT \
switch (left) {
case 7:
state->padding |= ((uint64_t) in[6]) << 48;
- /* fall through */
+ _fallthrough_;
case 6:
state->padding |= ((uint64_t) in[5]) << 40;
- /* fall through */
+ _fallthrough_;
case 5:
state->padding |= ((uint64_t) in[4]) << 32;
- /* fall through */
+ _fallthrough_;
case 4:
state->padding |= ((uint64_t) in[3]) << 24;
- /* fall through */
+ _fallthrough_;
case 3:
state->padding |= ((uint64_t) in[2]) << 16;
- /* fall through */
+ _fallthrough_;
case 2:
state->padding |= ((uint64_t) in[1]) << 8;
- /* fall through */
+ _fallthrough_;
case 1:
state->padding |= ((uint64_t) in[0]);
- /* fall through */
+ _fallthrough_;
case 0:
break;
}
if (!clock_boottime_supported())
return false;
- /* fall through */
-
+ _fallthrough_;
default:
/* For everything else, check properly */
return clock_gettime(clock, &ts) >= 0;
case JOB_RESTART:
t = JOB_STOP;
- /* fall through */
+ _fallthrough_;
case JOB_STOP:
r = unit_stop(u);
break;
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "load-fragment.h"
goto finish;
}
- /* fallthrough */
+ _fallthrough_;
case MANAGER_REBOOT:
case MANAGER_POWEROFF:
case MANAGER_HALT:
break;
}
- /* Fall through */
-
+ _fallthrough_;
case SIGINT:
if (MANAGER_IS_SYSTEM(m))
manager_handle_ctrl_alt_del(m);
case BIND_MOUNT:
rbind = false;
- /* fallthrough */
+ _fallthrough_;
case BIND_MOUNT_RECURSIVE:
/* Also chase the source mount */
break;
}
- /* Fall through */
-
+ _fallthrough_;
case SERVICE_START_POST:
if (s->pid_file_pathspec &&
main_pid_good(s) == 0 &&
break;
}
- /* Fall through */
-
+ _fallthrough_;
case SERVICE_RUNNING:
service_enter_running(s, f);
break;
}
cmd = RB_AUTOBOOT;
- /* Fall through */
-
+ _fallthrough_;
case RB_AUTOBOOT:
if (!in_container) {
if (socket_address_family(&p->address) == AF_NETLINK)
return "Netlink";
- /* fall through */
+ _fallthrough_;
default:
return NULL;
}
/* In a container we don't want to include the time the host
* was already up when the container started, so count from
* our own startup. */
- /* fall through */
+ _fallthrough_;
case TIMER_STARTUP:
base = UNIT(t)->manager->userspace_timestamp.monotonic;
break;
}
pos += r;
- } /* fall through */
-
+ }
+ _fallthrough_;
case ENTRY_REALTIME: {
usec_t realtime;
}
pos += r;
- } /* fall through */
-
+ }
+ _fallthrough_;
case ENTRY_MONOTONIC: {
usec_t monotonic;
sd_id128_t boot_id;
}
pos += r;
- } /* fall through */
-
+ }
+ _fallthrough_;
case ENTRY_BOOT_ID: {
sd_id128_t boot_id;
char sid[33];
}
pos += r;
- } /* fall through */
-
+ }
+ _fallthrough_;
case ENTRY_NEW_FIELD: {
u->field_pos = 0;
}
u->entry_state++;
- } /* fall through */
-
+ }
+ _fallthrough_;
case ENTRY_TEXT_FIELD:
case ENTRY_BINARY_FIELD: {
bool done;
u->field_pos = len + 1;
u->entry_state++;
- } /* fall through */
-
+ }
+ _fallthrough_;
case ENTRY_BINARY_FIELD_SIZE: {
uint64_t le64;
case OFFLINE_OFFLINING:
if (!__sync_bool_compare_and_swap(&f->offline_state, OFFLINE_OFFLINING, OFFLINE_DONE))
continue;
- /* fall through */
-
+ _fallthrough_;
case OFFLINE_DONE:
return;
if (!__sync_bool_compare_and_swap(&f->offline_state, OFFLINE_AGAIN_FROM_OFFLINING, OFFLINE_CANCEL))
continue;
/* Canceled restart from offlining, must wait for offlining to complete however. */
-
- /* fall through */
+ _fallthrough_;
default: {
int r;
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include <sys/socket.h>
#include "conf-parser.h"
if (*p == ' ')
break;
- /* fall through */
-
+ _fallthrough_;
case NUMBER:
if (*p < '0' || *p > '9')
return;
client’s IP address.
*/
- /* fall through */
case DHCP_STATE_REBINDING:
/* ’server identifier’ MUST NOT be filled in, ’requested IP address’
option MUST NOT be filled in, ’ciaddr’ MUST be filled in with
break;
}
- /* fall through */ /* for Soliciation Rapid Commit option check */
+ _fallthrough_; /* for Soliciation Rapid Commit option check */
case DHCP6_STATE_REQUEST:
case DHCP6_STATE_RENEW:
case DHCP6_STATE_REBIND:
return 0;
}
- /* fall through */
+ _fallthrough_;
case DHCP6_STATE_SOLICITATION:
client->state = DHCP6_STATE_SOLICITATION;
break;
}
- /* fall through */
-
+ _fallthrough_;
case IPV4ACD_STATE_WAITING_ANNOUNCE:
/* Send announcement packet */
r = arp_send_announcement(acd->fd, acd->ifindex, acd->address, &acd->mac_addr);
case SD_BUS_TYPE_STRING:
p = strempty(p);
- /* Fall through... */
+ _fallthrough_;
case SD_BUS_TYPE_OBJECT_PATH:
if (!p)
return -EINVAL;
* into the empty string */
p = strempty(p);
- /* Fall through... */
+ _fallthrough_;
case SD_BUS_TYPE_OBJECT_PATH:
if (!p)
goto fail;
}
- /* Fall through */
-
+ _fallthrough_;
case _SD_BUS_VTABLE_PROPERTY: {
struct vtable_member *m;
value = &uevent[i];
state = VALUE;
- /* fall through */ /* to handle empty property */
+ _fallthrough_; /* to handle empty property */
case VALUE:
if (strchr(NEWLINE, uevent[i])) {
uevent[i] = '\0';
if (buffer[32] != '\n')
return -EINVAL;
- /* fall through */
+ _fallthrough_;
case 32: /* plain UUID without trailing newline */
if (f == ID128_UUID)
return -EINVAL;
if (buffer[36] != '\n')
return -EINVAL;
- /* fall through */
+ _fallthrough_;
case 36: /* RFC UUID without trailing newline */
if (f == ID128_PLAIN)
return -EINVAL;
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "logind.h"
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "network-internal.h"
siphash24_compress(&prefix, sizeof(prefix), state);
}
- /* fallthrough */
+ _fallthrough_;
case AF_INET6:
/* local address */
siphash24_compress(&a->in_addr, FAMILY_ADDRESS_SIZE(a->family), state);
return 1;
}
- /* fall-through */
+ _fallthrough_;
case AF_INET6:
return memcmp(&a1->in_addr, &a2->in_addr, FAMILY_ADDRESS_SIZE(a1->family));
default:
return;
}
- /* fall through */
+ _fallthrough_;
case SD_DHCP6_CLIENT_EVENT_INFORMATION_REQUEST:
r = dhcp6_lease_information_acquired(client, link);
if (r < 0) {
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "networkd-conf.h"
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "networkd-conf.h"
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "nspawn-settings.h"
if (r < 0)
return log_oom();
- /* fall through */
-
+ _fallthrough_;
case 'n':
arg_network_veth = true;
arg_private_network = true;
if (strv_extend(&arg_network_ipvlan, optarg) < 0)
return log_oom();
- /* fall through */
-
+ _fallthrough_;
case ARG_PRIVATE_NETWORK:
arg_private_network = true;
arg_settings_mask |= SETTING_NETWORK;
return 0;
}
- /* fall through */
-
+ _fallthrough_;
case CLD_DUMPED:
log_error("Container %s terminated by signal %s.", arg_machine, signal_to_string(status.si_status));
return -EIO;
name, prefix, input = sys.argv[1:]
print("""\
+%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
+#endif
+%}""")
+print("""\
struct {}_name {{ const char* name; int id; }};
%null-strings
%%""".format(name))
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "resolved-conf.h"
if (path_startswith(i->path, "/dev"))
break;
- /* fallthrough */
-
+ _fallthrough_;
case IMAGE_RAW:
if (unlink(i->path) < 0)
return -errno;
if (file_attr & FS_IMMUTABLE_FL)
(void) chattr_path(i->path, 0, FS_IMMUTABLE_FL);
- /* fall through */
-
+ _fallthrough_;
case IMAGE_SUBVOLUME:
new_path = file_in_same_dir(i->path, new_name);
break;
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "timesyncd-conf.h"
log_debug("Quota for subvolume \"%s\" already in place, no change made.", i->path);
}
- /* fall through */
-
+ _fallthrough_;
case EMPTY_DIRECTORY:
r = path_set_perms(i, i->path);
if (q < 0)
#!/bin/sh -eu
awk ' BEGIN {
+ print "%{\n\
+#if __GNUC__ >= 7\n\
+_Pragma(\"GCC diagnostic ignored \\\"-Wimplicit-fallthrough\\\"\")\n\
+#endif\n\
+%}"
print "struct key_name { const char* name; unsigned short id; };"
print "%null-strings"
print "%%"
%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
#include <stddef.h>
#include "conf-parser.h"
#include "network-internal.h"
/* the kernel claims to have given a predictable name */
if (respect_predictable)
return false;
- /* fall through */
+ _fallthrough_;
case NET_NAME_ENUM:
default:
/* the name is known to be bad, or of an unknown type */
switch (retval) {
case SG_ERR_CAT_NOTSUPPORTED:
buf[1] = 0;
- /* Fallthrough */
+ _fallthrough_;
case SG_ERR_CAT_CLEAN:
case SG_ERR_CAT_RECOVERED:
retval = 0;
case SB_FORMAT:
udev_event_apply_format(event, name, nbuf, sizeof(nbuf), false);
name = nbuf;
- /* fall through */
+ _fallthrough_;
case SB_NONE:
value = udev_device_get_sysattr_value(dev, name);
if (value == NULL)