Skip to content

Conversation

fweimer-rh
Copy link
Contributor

Current glibc no longer implements the CRYPT extension, so it does not declare crypt in <unistd.h> in strict standard modes. The check defines _XOPEN_SOURCE, which enables one of these modes. Defining _DEFAULT_SOURCE as well again makes available the crypt function prototype.

This avoids a configure check result change with compilers which do not support implicit function declarations.

Related to:

Current glibc no longer implements the CRYPT extension, so it does not
declare crypt in <unistd.h> in strict standard modes.  The check
defines _XOPEN_SOURCE, which enables one of these modes.  Defining
_DEFAULT_SOURCE as well again makes available the crypt function
prototype.

This avoids a configure check result change with compilers which do
not support implicit function declarations.
@cmouse
Copy link
Contributor

cmouse commented Jan 2, 2023

Can you provide more information about what kind of thing this fixes?

@fweimer-rh
Copy link
Contributor Author

Without this change, building dovecot with a C99 compiler results in

checking if we should use _XPG6 macro for crypt()... no

while a compiler which supports C89-style implicit function declarations produces

checking if we should use _XPG6 macro for crypt()... yes

with the same system header files. Implicit function declarations were removed from the C language with C99, but current compilers merely report a warning and can still produce an executable if a symbol of that name is available at link time. Does this answer your question?

I don't know what the change in the configure check result means for the dovecot build.

@sirainen
Copy link
Contributor

sirainen commented Jan 2, 2023

Merged as dd691d4

@sirainen sirainen closed this Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants