Print this page
make: fix GCC warnings


 289         }
 290         sprintf(filename, NOCATGETS("%s-CPP"), ptr+1);
 291 #if defined(SUN5_0) || defined(HP_UX) || defined(linux)
 292         getcwd(curdir, sizeof(curdir));
 293 #else
 294         getwd(curdir);
 295 #endif
 296         if (strcmp(curdir, sdir) != 0 && strlen(iflag) > 2 && 
 297             iflag[2] != '/') {
 298                 /* Makefile must have had an "cd xx; cc ..." */
 299                 /* Modify the -I path to be relative to the cd */
 300                 newiflag = (char *)malloc(strlen(iflag) + strlen(curdir) + 2);
 301                 sprintf(newiflag, "-%c%s/%s", iflag[1], curdir, &iflag[2]);
 302                 report_dep(newiflag, filename);
 303         } else {
 304                 report_dep(iflag, filename);
 305         }
 306 }
 307 
 308 void
 309 report_dependency(register char *name)
 310 {
 311         register char   *filename;
 312         char            buffer[MAXPATHLEN+1];
 313         register char   *p;
 314         register char   *p2;
 315         char            nse_depinfo_file[MAXPATHLEN];
 316 
 317         if (report_file == NULL) {
 318                 if ((filename= getenv(SUNPRO_DEPENDENCIES)) == NULL) {
 319                         report_file = (FILE *)-1;
 320                         return;
 321                 }
 322                 if (strlen(filename) == 0) {
 323                         report_file = (FILE *)-1;
 324                         return;
 325                 }
 326                 (void)strcpy(buffer, name);
 327                 name = buffer;
 328                 p = strchr(filename, ' ');
 329                 if(p) {




 289         }
 290         sprintf(filename, NOCATGETS("%s-CPP"), ptr+1);
 291 #if defined(SUN5_0) || defined(HP_UX) || defined(linux)
 292         getcwd(curdir, sizeof(curdir));
 293 #else
 294         getwd(curdir);
 295 #endif
 296         if (strcmp(curdir, sdir) != 0 && strlen(iflag) > 2 && 
 297             iflag[2] != '/') {
 298                 /* Makefile must have had an "cd xx; cc ..." */
 299                 /* Modify the -I path to be relative to the cd */
 300                 newiflag = (char *)malloc(strlen(iflag) + strlen(curdir) + 2);
 301                 sprintf(newiflag, "-%c%s/%s", iflag[1], curdir, &iflag[2]);
 302                 report_dep(newiflag, filename);
 303         } else {
 304                 report_dep(iflag, filename);
 305         }
 306 }
 307 
 308 void
 309 report_dependency(const char *name)
 310 {
 311         register char   *filename;
 312         char            buffer[MAXPATHLEN+1];
 313         register char   *p;
 314         register char   *p2;
 315         char            nse_depinfo_file[MAXPATHLEN];
 316 
 317         if (report_file == NULL) {
 318                 if ((filename= getenv(SUNPRO_DEPENDENCIES)) == NULL) {
 319                         report_file = (FILE *)-1;
 320                         return;
 321                 }
 322                 if (strlen(filename) == 0) {
 323                         report_file = (FILE *)-1;
 324                         return;
 325                 }
 326                 (void)strcpy(buffer, name);
 327                 name = buffer;
 328                 p = strchr(filename, ' ');
 329                 if(p) {