View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000346 | mercury | Bug | public | 2014-07-11 17:41 | 2016-10-06 20:27 | ||||
Reporter | wangp | ||||||||
Assigned To | wangp | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000346: non-ANSI functions in header files | ||||||||
Description | dir.mih references DIR, but is included into C files compiled with gcc -ansi. For some reason this elicits an error from the gcc on AIX but seemingly not elsewhere. There might be other similar problems. | ||||||||
Tags | No tags attached. | ||||||||
Attached Files |
|
Notes | |
juliensf (administrator) 2014-07-11 20:08 |
It might be worth adding the dir module to the list of files in library/Mercury.options that are compiled with --no-ansi. OTOH, we should probably just not use -ansi at all -- IIRC, it (still) puts GCC into C90 mode (annoyingly it puts clang into C89 or GNU89 mode, which is slightly different). |
wangp (developer) 2014-07-14 10:26 |
Yes, I don't understand why dir.m hasn't required --no-ansi yet. The bigger problem is that the non-ANSI stuff leaks into the header files generated for dir.m and ends up being included into almost everything else. That stuff should be hidden away, and only appear in `local' foreign_decls, foreign_codes, and foreign_procs marked `may_not_duplicate'. |
juliensf (administrator) 2014-07-14 10:31 |
I'd perfectly happy simply to not use -ansi with GCC. (I had to disable its use with clang recently anyway.) Another problem with it is that it affects the compilation of user foreign_procs. Most of the systems we support these days support POSIX / C99 well enough that disabling it isn't going to be a problem. The one major system that doesn't, Windows, already requires special treatment everywhere anyway. |
juliensf (administrator) 2014-07-14 10:33 |
All that said, restricting the stuff in the dir module to appear in 'local' foreign pragmas is also a worthwhile change IMO. |
wangp (developer) 2016-10-06 20:27 |
Fixed as part of commit 1fbcfe3 (for dir.m anyway) |
Issue History | |||
Date Modified | Username | Field | Change |
---|---|---|---|
2014-07-11 17:41 | wangp | New Issue | |
2014-07-11 20:08 | juliensf | Note Added: 0000739 | |
2014-07-14 10:26 | wangp | Note Added: 0000743 | |
2014-07-14 10:31 | juliensf | Note Added: 0000744 | |
2014-07-14 10:33 | juliensf | Note Added: 0000745 | |
2016-10-06 20:27 | wangp | Assigned To | => wangp |
2016-10-06 20:27 | wangp | Status | new => resolved |
2016-10-06 20:27 | wangp | Resolution | open => fixed |
2016-10-06 20:27 | wangp | Note Added: 0000934 |