Print this page
11235 make -C fails under GCC7


2528                                 if (strncmp(argv[i+1], "DMAKE_OUTPUT_MODE=", length) == 0) {
2529                                         argv[i+1] = &argv[i+1][length];
2530                                         MBSTOWCS(wcs_buffer, "DMAKE_OUTPUT_MODE");
2531                                         name = GETNAME(wcs_buffer, FIND_LENGTH);
2532                                         dmake_output_mode_specified = dmake_add_mode_specified;
2533                                 } else {
2534                                         warning(gettext("Unknown argument `%s' after -x flag (ignored)"),
2535                                               argv[i+1]);
2536                                         argv[i] = argv[i + 1] = NULL;
2537                                         continue;
2538                                 }
2539                                 break;
2540                         case 2048: /* -C seen */
2541                                 if (argv[i + 1] == NULL) {
2542                                         fatal(gettext("No argument after -C flag"));
2543                                 }
2544                                 if (chdir(argv[i + 1]) != 0) {
2545                                         fatal(gettext("failed to change to directory %s: %s"),
2546                                             argv[i + 1], strerror(errno));
2547                                 }


2548                                 path_reset = true;
2549                                 rebuild_arg0 = true;
2550                                 (void) get_current_path();
2551                                 break;
2552                         default: /* Shouldn't reach here */
2553                                 argv[i] = NULL;
2554                                 continue;
2555                         }
2556                         argv[i] = NULL;
2557                         if (i == (argc - 1)) {
2558                                 break;
2559                         }
2560                         if ((length = strlen(argv[i+1])) >= MAXPATHLEN) {
2561                                 tmp_wcs_buffer = ALLOC_WC(length + 1);
2562                                 (void) mbstowcs(tmp_wcs_buffer, argv[i+1], length + 1);
2563                                 value = GETNAME(tmp_wcs_buffer, FIND_LENGTH);
2564                                 retmem(tmp_wcs_buffer);
2565                         } else {
2566                                 MBSTOWCS(wcs_buffer, argv[i+1]);
2567                                 value = GETNAME(wcs_buffer, FIND_LENGTH);




2528                                 if (strncmp(argv[i+1], "DMAKE_OUTPUT_MODE=", length) == 0) {
2529                                         argv[i+1] = &argv[i+1][length];
2530                                         MBSTOWCS(wcs_buffer, "DMAKE_OUTPUT_MODE");
2531                                         name = GETNAME(wcs_buffer, FIND_LENGTH);
2532                                         dmake_output_mode_specified = dmake_add_mode_specified;
2533                                 } else {
2534                                         warning(gettext("Unknown argument `%s' after -x flag (ignored)"),
2535                                               argv[i+1]);
2536                                         argv[i] = argv[i + 1] = NULL;
2537                                         continue;
2538                                 }
2539                                 break;
2540                         case 2048: /* -C seen */
2541                                 if (argv[i + 1] == NULL) {
2542                                         fatal(gettext("No argument after -C flag"));
2543                                 }
2544                                 if (chdir(argv[i + 1]) != 0) {
2545                                         fatal(gettext("failed to change to directory %s: %s"),
2546                                             argv[i + 1], strerror(errno));
2547                                 }
2548                                 MBSTOWCS(wcs_buffer, "DMAKE_CDIR");
2549                                 name = GETNAME(wcs_buffer, FIND_LENGTH);
2550                                 path_reset = true;
2551                                 rebuild_arg0 = true;
2552                                 (void) get_current_path();
2553                                 break;
2554                         default: /* Shouldn't reach here */
2555                                 argv[i] = NULL;
2556                                 continue;
2557                         }
2558                         argv[i] = NULL;
2559                         if (i == (argc - 1)) {
2560                                 break;
2561                         }
2562                         if ((length = strlen(argv[i+1])) >= MAXPATHLEN) {
2563                                 tmp_wcs_buffer = ALLOC_WC(length + 1);
2564                                 (void) mbstowcs(tmp_wcs_buffer, argv[i+1], length + 1);
2565                                 value = GETNAME(tmp_wcs_buffer, FIND_LENGTH);
2566                                 retmem(tmp_wcs_buffer);
2567                         } else {
2568                                 MBSTOWCS(wcs_buffer, argv[i+1]);
2569                                 value = GETNAME(wcs_buffer, FIND_LENGTH);