This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/41219] libgfortran build warnings



------- Comment #10 from sezeroz at gmail dot com  2009-09-07 11:27 -------
(In reply to comment #6)
> (In reply to comment #2)
> > Janne, I think the warning about "unix.c:750:15: warning: �statbuf.st_mode� may
> > be used uninitialized" is spurious, but can you have a look?
> 
> Yes, it's spurious, and I submitted a patch
> (http://gcc.gnu.org/ml/gcc-patches/2009-09/msg00419.html), but maybe the
> middle-end shouldn't warn about it anyway (see the reply by Richard Guenther).

The warning must be due to the inline fstat() implementation in
mingw-w64. Excerpt from stat.h:

__CRT_INLINE int __cdecl
 fstat(int _Desc,struct stat *_Stat) {
  struct _stat64 st;
  int ret=_fstat64(_Desc,&st);
  if (ret == -1) {
    memset(_Stat,0,sizeof(struct stat));
    return -1;
  }
 /* rest of the code */

Note that the memset() in the failure case was only recently added in our svn,
at rev. 1306, so this warning shouldn't be experienced with mingw-w64 rev.1306
or later. Older revisions didn't touch the input buffer on failure which should
be the reason for the warning.


-- 

sezeroz at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sezeroz at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41219


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]