Bug 95342

Summary: print_indent prototype missing from header
Product: PolicyKit Reporter: Brant Gurganus <brant>
Component: daemonAssignee: David Zeuthen (not reading bugmail) <zeuthen>
Status: RESOLVED MOVED QA Contact: David Zeuthen (not reading bugmail) <zeuthen>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Brant Gurganus 2016-05-10 21:36:34 UTC
The print_indent prototype is missing from the root/test/mocklibc/src/netgroup.h header. Because of the FILE definition being used, <stdio.h> also needs included.

The compilation affected is that of mocklibc-debug-netgroup. Currently that uses print_included without a formal prototype to ensure consistency between the implementation from netgroup.c and the usage in netgroup-debug.c. Without a proper prototype, the C compiler must guess at the calling convention which can be dangerous.

Again, this can be addressed by adding the <stdio.h> include and the print_include prototype to netgroup.h.
Comment 1 Miloslav Trmac 2016-05-11 13:57:57 UTC
Yes.

Or rather, the prototype should not be added into src/netgroup.h (a substitute for the public <netgroup.h>); it should be a private header file of mocklibc.

But it seems by far simplest to move the definition from netgroup.c to netgroup-debug.c, the only user; then we can make it static.

Would you like to provide a tested patch?
Comment 2 GitLab Migration User 2018-08-20 21:34:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/polkit/polkit/issues/5.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.