Bug 2179882 - cube: Inconsistency in autoconf checks regarding AC_INCLUDES_DEFAULT
Summary: cube: Inconsistency in autoconf checks regarding AC_INCLUDES_DEFAULT
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cube
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Florian Weimer
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PortingToModernCNoUpstream
TreeView+ depends on / blocked
 
Reported: 2023-03-20 10:44 UTC by Florian Weimer
Modified: 2023-03-20 12:56 UTC (History)
2 users (show)

Fixed In Version: cube-4.8.1-2.fc39
Clone Of:
Environment:
Last Closed: 2023-03-20 12:56:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
cube-configure-c99.patch (1.43 KB, patch)
2023-03-20 12:36 UTC, Florian Weimer
no flags Details | Diff

Description Florian Weimer 2023-03-20 10:44:03 UTC
ac_cube_posix_functions.m4 uses AC_CHECK_DECLS (which implies AC_INCLUDES_DEFAULT headers) to check for gethostid, gethosname, followed by a check for link-time availability using AC_LINK_IFELSE (not AC_CHECK_FUNC). The way AC_LINK_IFELSE used, AC_INCLUDES_DEFAULT headers are not applied, so the condition

            #if !HAVE_DECL_GETHOSTID
            long gethostid(void);
            #endif

does not give the right result because <unistd.h> is not included at this point even though HAVE_DECL_GETHOSTID is defined.

This causes problems with future compilers which do not support implicit function declarations.

Filing this here because upstream does not seem to have a public bug tracker.

Comment 1 Dave Love 2023-03-20 12:04:08 UTC
I've forwarded it to the maintainers, thanks.
Is this just a problem for gcc 14, i.e. not imminent?

Comment 2 Florian Weimer 2023-03-20 12:15:12 UTC
(In reply to Dave Love from comment #1)
> I've forwarded it to the maintainers, thanks.

Okay, then I'll hold off sending my message. I'm testing a patch.

> Is this just a problem for gcc 14, i.e. not imminent?

I want to add approximating -Werror flags to the default flags fairly soon, certainly before GCC 14 lands in December or so.

For upstream, it might be more pressing because they also have users with Clang, which has already made the switch.

Comment 3 Florian Weimer 2023-03-20 12:36:21 UTC
Created attachment 1952064 [details]
cube-configure-c99.patch

This patch seems to work. Upstream may need a different approach (e.g. for systems which do not have <unistd.h>).


Note You need to log in before you can comment on or make changes to this bug.