#include <assert.h>
#include <signal.h>
+/** clang 10 doesn't recognised the FALL-THROUGH comment anymore
+ */
+#if (defined(__clang__) && (__clang_major__ >= 10)) || (defined(__GNUC__) && __GNUC__ >= 7)
+# define FALL_THROUGH CC_HINT(fallthrough)
+#else
+# define FALL_THROUGH ((void)0)
+#endif
+
+#define XSTRINGIFY(x) #x
+#define STRINGIFY(x) XSTRINGIFY(x)
+
/** The set of executables used
*
*/
#define PATH_MAX 1024
#endif
-#define XSTRINGIFY(x) #x
-#define STRINGIFY(x) XSTRINGIFY(x)
-
/* We want to say we are libtool 1.4 for shlibtool compatibility. */
#define VERSION "1.4"
static void add_rpath(count_chars *cc, char const *path);
static pid_t spawn_pid;
-char const *program = NULL;
+static char const *program = NULL;
static void usage(int code)
{
else {
int status;
-#define SIGNAL_FORWARD(_sig) if (signal(_sig, external_spawn_sig_handler) < 0) \
+#define SIGNAL_FORWARD(_sig) if (signal(_sig, external_spawn_sig_handler) == SIG_ERR) \
do { \
fprintf(stderr, "Failed setting signal handler for %i: %s\n", _sig, strerror(errno)); \
exit(EXIT_FAILURE); \
errno = 0;
- rv = strtol(nptr, (char**)endptr, 10);
+ rv = strtol(nptr, (char**)endptr, base);
if (errno == ERANGE) {
return 0;
break;
}
pass = 1;
- /* Fall through */
+ FALL_THROUGH;
+
case 1:
strcpy(ext, target->static_lib_ext);
*libtype = TYPE_STATIC_LIB;
push_count_chars(cmd->arglist, cmd->output_name);
}
break;
-
+
case MODE_LINK:
link_fixup(cmd);
break;