You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3917 Reporter: monniaux Status: acknowledged (set by @damiendoligez on 2005-12-15T12:23:39Z) Resolution: open Priority: normal Severity: feature Version: 3.09.0 Category: configure and build/install Tags: patch Related to:#7000 Monitored by:@jmeber
Bug description
If cc is icc (Intel's compiler) version 9, config/auto-aux/hasgot will fail to detect most library functions.
The reason is that hasgot tests whether library function f exists by compiling and linking the following template file:
main() {
f();
}
icc refuses to compile such a file if f is a C standard library function and the number of arguments of f does not correspond to that in the C standard.
The result is that, for instance, HAS_GETTIMEOFDAY will be undefined and the corresponding OCaml function will always raise Invalid_argument.
Additional information
Such behaviour is apparently correct with respect to the C99 standard, section 7.1.4, as recalled in appendix J.2 (i.e. calls to library functions with incorrect number of arguments have undefined behaviour).
I do not know whether it is possible to stop icc from doing so, I do not see any applicable option (safe perhaps for telling it not to use stdlib).
My personal fix is to test for the library functions using gcc, but it is obviously broken in general.
I suggest the hasgot script should be replaced by a script testing for the functions using appropriate arguments.
I disagree with david's analysis :) I believe the UB in section 7.1.4 is about incorrect number of arguments in calls to library functions with variable number of parameters. Here the problem is simply that there is no declarator at all for the called function.
Adding a (bogus) declarator one is enough to turn the compiler error into a warning.
Configuration has been entirely rewritten using GNU autoconf, which has different, more clever ways to test availability of library functions. Optimistically, I think the present issue goes away, and so I'm closing it. There might remain other issues with ICC, though.
Original bug ID: 3917
Reporter: monniaux
Status: acknowledged (set by @damiendoligez on 2005-12-15T12:23:39Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.09.0
Category: configure and build/install
Tags: patch
Related to: #7000
Monitored by: @jmeber
Bug description
If cc is icc (Intel's compiler) version 9, config/auto-aux/hasgot will fail to detect most library functions.
The reason is that hasgot tests whether library function f exists by compiling and linking the following template file:
main() {
f();
}
icc refuses to compile such a file if f is a C standard library function and the number of arguments of f does not correspond to that in the C standard.
The result is that, for instance, HAS_GETTIMEOFDAY will be undefined and the corresponding OCaml function will always raise Invalid_argument.
Additional information
Such behaviour is apparently correct with respect to the C99 standard, section 7.1.4, as recalled in appendix J.2 (i.e. calls to library functions with incorrect number of arguments have undefined behaviour).
I do not know whether it is possible to stop icc from doing so, I do not see any applicable option (safe perhaps for telling it not to use stdlib).
My personal fix is to test for the library functions using gcc, but it is obviously broken in general.
I suggest the hasgot script should be replaced by a script testing for the functions using appropriate arguments.
File attachments
The text was updated successfully, but these errors were encountered: