|Anonymous | Login | Signup for a new account||2016-07-30 04:08 CEST|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003917||OCaml||OCaml general||public||2005-12-12 18:47||2013-09-03 16:57|
|Target Version||Fixed in Version|
|Summary||0003917: ocaml won't compile correctly with icc 9.0 (many standard library calls with end up ending up in Invalid_argument)|
|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:
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.
|Attached Files||hasgot-icc.patch [^] (432 bytes) 2007-02-05 09:15 [Show Content]|
This is going to take a lot of work to fix properly.
|One dirty practical hack is to configure under gcc, save s.h, configure with icc, and put back the saved s.h.|
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.
|2005-12-12 18:47||monniaux||New Issue|
|2005-12-15 13:23||doligez||Note Added: 0003440|
|2005-12-15 13:23||doligez||Severity||minor => feature|
|2005-12-15 13:23||doligez||Status||new => acknowledged|
|2006-11-24 15:49||monniaux||Note Added: 0003862|
|2007-02-05 09:15||oandrieu||File Added: hasgot-icc.patch|
|2007-02-05 09:15||oandrieu||Note Added: 0003913|
|2013-09-03 16:57||doligez||Tag Attached: patch|
|Copyright © 2000 - 2011 MantisBT Group|