Skip to content

Build fails with ghostscript-printer-app.c:152:26: error: too many arguments to function ‘cupsArrayNew’; expected 2, have 6. #30

Done

Description

@dreirund

I am trying to build this on Artix GNU/Linux (rolling release) using this recipe.

Build fails with

cc -march=native -mtune=native -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -fstack-clash-protection -fcf-protection -w -flto=auto `pkg-config --cflags pappl` -I/usr/include/p11-kit-1 -D_REENTRANT -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/elogind `pkg-config --cflags libppd` `pkg-config --cflags libcupsfilters` `pkg-config --cflags libpappl-retrofit` -Os -g -DSYSTEM_VERSION_STR="\"1.0\"" -DSYSTEM_VERSION_ARR_0=`echo 1.0 | perl -p -e 's/^(\d+).*$/\1/'` -DSYSTEM_VERSION_ARR_1=`echo 1.0 | perl -p -e 's/^\d+\D+(\d+).*$/\1/'` -DSYSTEM_VERSION_ARR_2=`echo 1.0 | perl -p -e 's/^\d+\D+\d+\D+(\d+).*$/\1/'` -DSYSTEM_VERSION_ARR_3=`echo 1.0 | perl -p -e 's/^\d+\D+\d+\D+\d+\D+(\d+).*$/\1/'` -c -o ghostscript-printer-app.o ghostscript-printer-app.c
ghostscript-printer-app.c: In function ‘main’:
ghostscript-printer-app.c:152:26: error: too many arguments to function ‘cupsArrayNew’; expected 2, have 6
  152 |   spooling_conversions = cupsArrayNew(NULL, NULL, NULL, 0, NULL, NULL);
      |                          ^~~~~~~~~~~~             ~~~~
In file included from /usr/include/cups/http.h:20,
                 from /usr/include/cups/ipp.h:19,
                 from /usr/include/cups/cups.h:28,
                 from /usr/include/pappl/base.h:12,
                 from /usr/include/pappl/device.h:12,
                 from /usr/include/pappl/pappl.h:12,
                 from /usr/include/pappl-retrofit.h:21,
                 from ghostscript-printer-app.c:16:
/usr/include/cups/array.h:64:26: note: declared here
   64 | extern cups_array_t     *cupsArrayNew(cups_array_func_t f, void *d) _CUPS_API_1_2;
      |                          ^~~~~~~~~~~~
ghostscript-printer-app.c:171:20: error: too many arguments to function ‘cupsArrayNew’; expected 2, have 6
  171 |   stream_formats = cupsArrayNew(NULL, NULL, NULL, 0, NULL, NULL);
      |                    ^~~~~~~~~~~~             ~~~~
/usr/include/cups/array.h:64:26: note: declared here
   64 | extern cups_array_t     *cupsArrayNew(cups_array_func_t f, void *d) _CUPS_API_1_2;
      |                          ^~~~~~~~~~~~
ghostscript-printer-app.c:178:33: error: too many arguments to function ‘cupsArrayNew’; expected 2, have 6
  178 |   driver_selection_regex_list = cupsArrayNew(NULL, NULL, NULL, 0, NULL, NULL);
      |                                 ^~~~~~~~~~~~             ~~~~
/usr/include/cups/array.h:64:26: note: declared here
   64 | extern cups_array_t     *cupsArrayNew(cups_array_func_t f, void *d) _CUPS_API_1_2;
      |                          ^~~~~~~~~~~~
make: *** [Makefile:95: ghostscript-printer-app.o] Error 1

Software versions:

  • GCC: 16.2.1
  • CUPS: 2.4.20
  • PAPPL: 1.4.12

Seems to be similar issue as this one in hplip-printer-app.

Regards!

Activity

  1. tillkamppeter commented on Nov 23, 2026

    @tillkamppeter
    Member

    Probably this PR from ps-printer-app

    OpenPrinting/ps-printer-app#41

    applied to this one should be the fix. @AdeshDeshmukh ?

  2. AdeshDeshmukh commented on Nov 24, 2026

    @AdeshDeshmukh
    Contributor

    Hi @tillkamppeter and @dreirund,

    I have submitted the dedicated fix in PR #31: #31

    It wraps cupsArrayNew with #if CUPS_VERSION_MAJOR >= 3 to restore full backward compatibility with CUPS 2.x (2 arguments) while preserving CUPS 3.x support (6 arguments). See full root cause analysis on OpenPrinting/hplip-printer-app#31.

  3. added a commit that references this issue on Nov 24, 2026
    acf18a4
  4. dreirund commented on Nov 24, 2026

    @dreirund
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions