This is the mail archive of the gcc-patches@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]

Re: [PATCH, libgfortran] Fix for PR 18982


On Wednesday 12 January 2005 22:54, Thomas Koenig wrote:
> Here's (again) a patch for PR 18982.  I've tried following
> the conventions for the Changelog entries more closely now and
> regenerated the patch (which was affected by one of the formatting
> patches).
>
> Original patch at http://gcc.gnu.org/ml/gcc-patches/2005-01/msg00024.html
>
> Boostrapped and regression-tested on i386-unknown-linux-gnu,
> without regressions.
>
> Ok?
>
> 2005-01-12  Thomas Koenig  <Thomas.Koenig@online.de>
>
> 	PR libfortran/18982
> 	* io/unix.c: Use bitwise negation instead of logical
> 	negation to mask open flags
>
> 2005-01-12  Thomas Koenig  <Thomas.Koenig@online.de>
>
>         * gfortran.dg/open_new.f90: new testcase

--- 1060,1070 ----
      {
        if (fd < 0)
          {
-           rwflag = rwflag & !O_RDWR | O_RDONLY;
+           rwflag &= ~(!O_RDWR | O_RDONLY);
            fd = open (path, rwflag, mode);
            if (fd < 0)
              {
- 	      rwflag = rwflag & !O_RDONLY | O_WRONLY;
+ 	      rwflag &= (!O_RDONLY | O_WRONLY);
                fd = open (path, rwflag, mode);
                if (fd < 0)
                  flags->action = ACTION_READWRITE; /* Could not open at all.  */

Why is the logical not (the '!') still there if you say "instead"?

Gr.
Steven


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