make returning several ppd related errors -> include cups/ppd.h needed

Issue #3 resolved
Anonymous created an issue

Make is returning several warnings and errors of implicit function declarations when issuing the make command:

if gcc -DHAVE_CONFIG_H -I. -I. -I.  -D_GNU_SOURCE   -g -O2 -MT rastertoptch-rastertoptch.o -MD -MP -MF ".deps/rastertoptch-rastertoptch.Tpo" -c -o rastertoptch-rastertoptch.o `test -f 'rastertoptch.c' || echo './'`rastertoptch.c; \
then mv -f ".deps/rastertoptch-rastertoptch.Tpo" ".deps/rastertoptch-rastertoptch.Po"; else rm -f ".deps/rastertoptch-rastertoptch.Tpo"; exit 1; fi
rastertoptch.c: In function parse_options:
rastertoptch.c:474:3: error: unknown type name ppd_file_t
   ppd_file_t  *ppd;  /* PPD file */
   ^~~~~~~~~~
rastertoptch.c:479:9: warning: implicit declaration of function ppdOpenFile [-Wimplicit-function-declaration]
   ppd = ppdOpenFile(getenv("PPD"));
         ^~~~~~~~~~~
rastertoptch.c:479:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
   ppd = ppdOpenFile(getenv("PPD"));
       ^
rastertoptch.c:481:5: error: unknown type name ppd_status_t
     ppd_status_t status;  /* PPD error */
     ^~~~~~~~~~~~
rastertoptch.c:486:14: warning: implicit declaration of function ppdLastError [-Wimplicit-function-declaration]
     status = ppdLastError(&linenum);
              ^~~~~~~~~~~~
rastertoptch.c:488:48: warning: implicit declaration of function ppdErrorString [-Wimplicit-function-declaration]
     fprintf(stderr, "DEBUG: %s on line %d.\n", ppdErrorString(status), linenum);
                                                ^~~~~~~~~~~~~~
rastertoptch.c:488:30: warning: format %s expects argument of type char *, but argument 3 has type int [-Wformat=]
     fprintf(stderr, "DEBUG: %s on line %d.\n", ppdErrorString(status), linenum);
                              ^
rastertoptch.c:492:3: warning: implicit declaration of function ppdMarkDefaults [-Wimplicit-function-declaration]
   ppdMarkDefaults(ppd);
   ^~~~~~~~~~~~~~~
rastertoptch.c:493:3: warning: implicit declaration of function cupsMarkOptions [-Wimplicit-function-declaration]
   cupsMarkOptions(ppd, num_options, cups_options);
   ^~~~~~~~~~~~~~~
rastertoptch.c:496:5: error: unknown type name ppd_choice_t
     ppd_choice_t *choice = ppdFindMarkedChoice(ppd, "RollFedMedia");
     ^~~~~~~~~~~~
rastertoptch.c:496:28: warning: implicit declaration of function ppdFindMarkedChoice [-Wimplicit-function-declaration]
     ppd_choice_t *choice = ppdFindMarkedChoice(ppd, "RollFedMedia");
                            ^~~~~~~~~~~~~~~~~~~
rastertoptch.c:496:28: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
rastertoptch.c:497:90: error: request for member choice in something not a structure or union
     fprintf(stderr, "DEBUG: Markedchoice for roll fed media is '%s', text '%s'\n", choice->choice, choice->text);
                                                                                          ^~
rastertoptch.c:497:106: error: request for member text in something not a structure or union
     fprintf(stderr, "DEBUG: Markedchoice for roll fed media is '%s', text '%s'\n", choice->choice, choice->text);
                                                                                                          ^~
rastertoptch.c:499:38: error: request for member choice in something not a structure or union
       = (strcasecmp ("Labels", choice->choice) != 0);
                                      ^~
rastertoptch.c:557:3: warning: implicit declaration of function ppdClose [-Wimplicit-function-declaration]
   ppdClose(ppd);
   ^~~~~~~~
Makefile:324: recipe for target 'rastertoptch-rastertoptch.o' failed
make[1]: *** [rastertoptch-rastertoptch.o] Error 1

Resolution: rastertoptch.c needs to include cups/ppd.h otherwise a compilation fails.

Comments (3)

  1. Log in to comment