Changeset 3145


Ignore:
Timestamp:
Mar 15, 2018, 1:00:09 AM (7 years ago)
Author:
bird
Message:

kmk: warnings found by gcc 7.3.0

Location:
trunk/src/kmk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/function.c

    r3141 r3145  
    32953295
    32963296  /* second: the command for the subsequent command lines. defaults to the initial cmd. */
    3297   subsequent_cmd = argc > 2 && argv[1][0] != '\0' ? argv[1] : "";
     3297  subsequent_cmd = argc > 2 && argv[1][0] != '\0' ? argv[1] : "\0";
    32983298  while (ISSPACE (*subsequent_cmd))
    3299     subsequent_cmd++;
     3299    subsequent_cmd++;   /* gcc 7.3.0 complains "offset ‘1’ outside bounds of constant string" if constant is "" rather than "\0". */
    33003300  if (*subsequent_cmd)
    33013301    {
     
    33113311
    33123312  /* third: the final command. defaults to the subseq cmd. */
    3313   final_cmd = argc > 3 && argv[2][0] != '\0' ? argv[2] : "";
     3313  final_cmd = argc > 3 && argv[2][0] != '\0' ? argv[2] : "\0";
    33143314  while (ISSPACE (*final_cmd))
    3315     final_cmd++;
     3315    final_cmd++;    /* gcc 7.3.0: same complaint as for subsequent_cmd++ */
    33163316  if (*final_cmd)
    33173317    {
  • trunk/src/kmk/kmkbuiltin/cp.c

    r2996 r3145  
    427427                                continue;
    428428                        }
     429                        /* fall thru */
    429430                case FTS_DNR:
    430431                case FTS_ERR:
  • trunk/src/kmk/kmkbuiltin/fts.c

    r3109 r3145  
    14241424
    14251425#ifdef HAVE_FCHDIR
    1426         if (oldfd < 0 && (fd = open(path, O_RDONLY)) == -1)
    1427                 return -1;
     1426        if (oldfd < 0) {
     1427                if (!path) /* shuts up gcc nonull checks*/
     1428                        return -1;
     1429                fd = open(path, O_RDONLY);
     1430                if (fd == -1)
     1431                        return -1;
     1432        }
    14281433
    14291434        if (fstat(fd, &sb) == -1)
  • trunk/src/kmk/kmkbuiltin/install.c

    r3115 r3145  
    3232 */
    3333
    34 #ifndef lint
     34#if 0 /*ndef lint*/
    3535static const char copyright[] =
    3636"@(#) Copyright (c) 1987, 1993\n\
  • trunk/src/kmk/kmkbuiltin/printf.c

    r3140 r3145  
    8484
    8585
    86 #ifdef __GNUC__
     86#if 0 /*def __GNUC__ - bird: gcc complains about non-ISO-standard escape. */
    8787#define ESCAPE '\e'
    8888#else
  • trunk/src/kmk/kmkbuiltin/redirect.c

    r3140 r3145  
    15671567                            break;
    15681568                        }
     1569                        /* fall thru */
    15691570                    case '1':
    15701571                    case '2':
  • trunk/src/kmk/read.c

    r3140 r3145  
    33953395          break;
    33963396        }
     3397      /* fall thru */
    33973398
    33983399    default:
Note: See TracChangeset for help on using the changeset viewer.