Bug 2189133

Summary: a2ps: FTBFS in rawhide, 64-bit and C99 compatibility issues
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: a2psAssignee: Zdenek Dohnal <zdohnal>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: rawhideCC: orion, twaugh, zdohnal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-07-27 16:06:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2137512    

Description Florian Weimer 2023-04-24 10:28:30 UTC
lib/path-concat.c redefines mempcpy before including <string.h>, causing a parse error in the header file (GCC's context reporting isn't great here):

path-concat.c:25:29: error: expected identifier or '(' before 'void'
   25 | # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
      |                             ^~~~
path-concat.c:25:37: error: expected ')' before '(' token
   25 | # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
      |                                     ^

Overall, the package is in a very bad state.

There are also many implicit function declarations during the build, like this example later in the same file:

path-concat.c: In function 'path_concat':
path-concat.c:81:23: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   81 |   p_concat = (char *) malloc (dir_len + base_len + 2);
      |                       ^~~~~~

These will be hard build failures with future compilers, and also tend to cause crashes on 64-bit architectures (if pointers are truncated to int).

The gperf configure version test does not work because it cannot cope with multi-line output from gperf --version.

I'm not sure if it is worth fixing this package because it still does not support UTF-8.

Reproducible: Always

Comment 1 Zdenek Dohnal 2023-04-27 12:56:00 UTC
Hi Florian,

thank you for reporting the issue!

There is a new a2ps version with new upstream https://bugzilla.redhat.com/show_bug.cgi?id=2176254 , I'll try to update to the newest version and we will see how many issue will be fixed.

Comment 2 Orion Poplawski 2023-06-04 20:37:54 UTC
Any progress on the update?

Comment 3 Zdenek Dohnal 2023-06-05 06:35:22 UTC
I'm in the process of rebasing the package to the latest version - https://bugzilla.redhat.com/show_bug.cgi?id=2176254 - it has many downstream patches, so in case you are in hurry, please send a PR with rebase and I'll review it.

Comment 4 Zdenek Dohnal 2023-07-27 16:06:32 UTC
Fixed in rawhide https://koji.fedoraproject.org/koji/taskinfo?taskID=104013671