Bug 707868

Summary: Wrong function called in gdevescp.c
Product: Ghostscript Reporter: Jan Palus <punk.song7865>
Component: Printer DriverAssignee: Default assignee <ghostpdl-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: chris.liddell
Priority: P2    
Version: 10.03.1   
Hardware: Other   
OS: Linux   
Customer: Word Size: ---

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!