Bug 707868 - Wrong function called in gdevescp.c
Summary: Wrong function called in gdevescp.c
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Printer Driver (show other bugs)
Version: 10.03.1
Hardware: Other Linux
: P2 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-10 13:04 UTC by Jan Palus
Modified: 2024-07-11 11:17 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Palus 2024-07-10 13:04:09 UTC
If A4 is defined gdevescp.c tries to call fwrite instead of gp_fwrite:

#ifdef A4
        /*
        ** After reset, the Stylus is set up for US letter paper.
        ** We need to set the page size appropriately for A4 paper.
        ** For some bizarre reason the ESC/P2 language wants the bottom
        ** margin measured from the *top* of the page:
        */

        fwrite("\033(U\001\0\n\033(C\002\0t\020\033(c\004\0\0\0t\020",
                                                        1, 22, prn_stream);
#endif

https://git.ghostscript.com/?p=ghostpdl.git;a=blob;f=devices/gdevescp.c;h=91a9205272954c17cdb763c1ea4afb09a03239d0;hb=HEAD#l165

Leading to build failure with stricter compilers like ie GCC 14.
Comment 1 Chris Liddell (chrisl) 2024-07-11 11:17:23 UTC
That file and a couple of others that were missed are fixed in this commit:

https://cgit.ghostscript.com/cgi-bin/cgit.cgi/ghostpdl.git/commit/?id=73a5763fd9d15

Thanks for spotting that!