From: SourceForge.net <no...@so...> - 2009-02-15 00:46:53
|
Bugs item #2567153, was opened at 2009-02-05 08:10 Message generated for change (Comment added) made by foobar57 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2567153&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: mingw runtime Group: None Status: Open Resolution: None Priority: 3 Private: No Submitted By: Alexey Pushkin (foobar57) Assigned to: Nobody/Anonymous (nobody) Summary: unistd.h doesn't work with -D_NO_OLDNAMES Initial Comment: because ftruncate() is declared as int ftruncate(int, off_t) instead of int ftruncate(int, _off_t) (at the bottom of the unistd.h) ---------------------------------------------------------------------- >Comment By: Alexey Pushkin (foobar57) Date: 2009-02-15 01:46 Message: Well, now I'll try my best not to "poison" more. The thing is that now Microsoft guards *EVERYTHING* with a __STRICT_ANSI__-like thing, _NO_OLDNAMES is in fact a Mingw-specific macro now. So if you want to be really compatible with Microsoft, you should replace _NO_OLDNAMES with __STRICT_ANSI__ *everywhere*. But this is a subject to another discussion and another ticket. For now Mingw uses _NO_OLDNAMES for this purpose. Therefore, for consistency with the rest of Mingw 'off_t' should IMHO be guarded by _NO_OLDNAMES, regardless of the "poison". ---------------------------------------------------------------------- Comment By: Keith Marshall (keithmarshall) Date: 2009-02-15 01:26 Message: Alexey, Thanks for the apology; unfortunately, the damage has been done. Kia, I think the best, and cleanest solution, is just to remove the _NO_OLDNAMES guard from around the `off_t' typedef in sys/types.h, and to leave unistd.h as is. That way, we don't introduce any conflict with POSIX, or GCC's usage. In fact, _NO_OLDNAMES was never the correct guard here. Microsoft have actually done the right thing, by guarding on their equivalent of __STRICT_ANSI__, since ANSI C99 doesn't define `off_t'. Unfortunately, the poisoning of this ticket by actual Microsoft source means that we cannot now hide the definition for the strict ANSI case; to progress that, we would have to wait until someone with no association to this ticket raises a new bug report, (after sufficient time for the details of this discussion to have been forgotten). ---------------------------------------------------------------------- Comment By: Alexey Pushkin (foobar57) Date: 2009-02-14 14:10 Message: Guys, sorry for "polluting" this report :-) ---------------------------------------------------------------------- Comment By: Kai Tietz (ktietz70) Date: 2009-02-13 18:36 Message: As I answered before seen these header parts, I think this would be a valid way too: "I think the best would be to change the type just for the case, when NO_OLDNAMES is defined. Otherwise we would get in conflict with POSIX. Eg. gcc in sys.protos.h declares it by using off_t. This would lead to warnings. Do you think this is ok?" ---------------------------------------------------------------------- Comment By: Keith Marshall (keithmarshall) Date: 2009-02-13 18:16 Message: To qualify that further, (since POSIX specific names normally *are* guarded by _NO_OLDNAMES, in MinGW headers), removal of the guard in this case, is required to conform to the MSDN documentation, (which we *can* use as a legitimate reference source), irrespective of what Microsoft actually put in their own headers, (which we have no legitimate way to determine); we are obliged to implement it as *documented*, (on MSDN). POSIX requires sys/types.h to define `off_t'; so does MSDN. ---------------------------------------------------------------------- Comment By: Keith Marshall (keithmarshall) Date: 2009-02-13 18:02 Message: So, now you have polluted this report with information you have abstracted from an illegitimate source, (MS proprietary headers), which we *cannot* use as a basis for fixing this. Neither can we use any further information which you provide, related to this topic. Thanks a bunch! In any case, what is said in the comment in that snippet is misleading; the standard type name, *required* by *POSIX*, (this type is not required by ANSI C99 at all, AFAICT), is `off_t', *not* `_off_t'. The only solutions which I will now consider to be acceptable, is the one I'd already suggested, prior to your pollution of the ticket, viz. removal of the _NO_OLDNAMES guard around the typedef of `off_t', or your original suggestion that unistd.h refer only to `_off_t'. Of these two, I prefer the POSIX conforming choice; (POSIX *requires* sys/types.h to define `off_t'). ---------------------------------------------------------------------- Comment By: Alexey Pushkin (foobar57) Date: 2009-02-12 07:03 Message: Since I cross-posted this issue to the mingw-w64 tracker, here is a link: https://sourceforge.net/tracker2/?func=detail&atid=983354&aid=2582769&group_id=202880 ---------------------------------------------------------------------- Comment By: Keith Marshall (keithmarshall) Date: 2009-02-10 13:56 Message: Hmm. According to MSDN: http://msdn.microsoft.com/en-us/library/323b6b3k.aspx *both* off_t and _off_t should be defined as standard data types, (and both serving the same purpose). I'm wondering if the real bug here is not in sys/types.h? Perhaps off_t should be type defined, irrespective of _NO_OLDNAMES. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=2567153&group_id=2435 |