Giter Site home page Giter Site logo

Comments (11)

Fish-Git avatar Fish-Git commented on August 23, 2024

Fixed by commit 873c8ba.

Closing.

from hyperion.

wrljet avatar wrljet commented on August 23, 2024

Here's a bunch I just ran into, on Debian 12, with gcc 12.2.0.

Using commit: 140a0cf

 CC       dat.lo
In file included from ../hercules.h:104,
                 from ../cpu.c:43:
../cpu.c: In function ‘s370_process_interrupt’:
../cpu.c:1876:29: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 9 has type ‘char *’ [-Wformat=]
 1876 |                     "auto-" );
      |                     ~~~~~~~ ^
      |                     |
      |                     char *
../msgenu.h:99:98: note: in definition of macro ‘PFWRITEMSG’
   99 | #define PFWRITEMSG( pan, f, fmt, ... ) fwritemsg( __FILE__, __LINE__, __FUNCTION__, pan,   f,    fmt, ## __VA_ARGS__ )
      |                                                                                                  ^~~
../msgenu.h:108:36: note: in expansion of macro ‘PWRITEMSG’
  108 | #define  LOGMSG(      fmt,   ... ) PWRITEMSG(  WRMSG_NORMAL,       fmt,                 ## __VA_ARGS__ )
      |                                    ^~~~~~~~~
../msgenu.h:110:36: note: in expansion of macro ‘LOGMSG’
  110 | #define  WRMSG(     id, sev, ... ) LOGMSG(                      #id "%s " id "\n", sev, ## __VA_ARGS__ )
      |                                    ^~~~~~
../cpu.c:1875:17: note: in expansion of macro ‘WRMSG’
 1875 |                 WRMSG( HHC00826, "W", PTYPSTR( sysblk.pcpu ),
      |                 ^~~~~
../cpu.c:1876:29: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
 1876 |                     "auto-" );
      |                             ^
../msgenu.h:99:98: note: in definition of macro ‘PFWRITEMSG’
   99 | #define PFWRITEMSG( pan, f, fmt, ... ) fwritemsg( __FILE__, __LINE__, __FUNCTION__, pan,   f,    fmt, ## __VA_ARGS__ )
      |                                                                                                  ^~~
../msgenu.h:108:36: note: in expansion of macro ‘PWRITEMSG’
  108 | #define  LOGMSG(      fmt,   ... ) PWRITEMSG(  WRMSG_NORMAL,       fmt,                 ## __VA_ARGS__ )
      |                                    ^~~~~~~~~
../msgenu.h:110:36: note: in expansion of macro ‘LOGMSG’
  110 | #define  WRMSG(     id, sev, ... ) LOGMSG(                      #id "%s " id "\n", sev, ## __VA_ARGS__ )
      |                                    ^~~~~~
../cpu.c:1875:17: note: in expansion of macro ‘WRMSG’
 1875 |                 WRMSG( HHC00826, "W", PTYPSTR( sysblk.pcpu ),
      |                 ^~~~~
../cpu.c: In function ‘s390_process_interrupt’:
../cpu.c:1876:29: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 9 has type ‘char *’ [-Wformat=]
 1876 |                     "auto-" );
      |                     ~~~~~~~ ^
      |                     |
      |                     char *
../msgenu.h:99:98: note: in definition of macro ‘PFWRITEMSG’
   99 | #define PFWRITEMSG( pan, f, fmt, ... ) fwritemsg( __FILE__, __LINE__, __FUNCTION__, pan,   f,    fmt, ## __VA_ARGS__ )
      |                                                                                                  ^~~
../msgenu.h:108:36: note: in expansion of macro ‘PWRITEMSG’
  108 | #define  LOGMSG(      fmt,   ... ) PWRITEMSG(  WRMSG_NORMAL,       fmt,                 ## __VA_ARGS__ )
      |                                    ^~~~~~~~~
../msgenu.h:110:36: note: in expansion of macro ‘LOGMSG’
  110 | #define  WRMSG(     id, sev, ... ) LOGMSG(                      #id "%s " id "\n", sev, ## __VA_ARGS__ )
      |                                    ^~~~~~
../cpu.c:1875:17: note: in expansion of macro ‘WRMSG’
 1875 |                 WRMSG( HHC00826, "W", PTYPSTR( sysblk.pcpu ),
      |                 ^~~~~
../cpu.c:1876:29: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
 1876 |                     "auto-" );
      |                             ^
../msgenu.h:99:98: note: in definition of macro ‘PFWRITEMSG’
   99 | #define PFWRITEMSG( pan, f, fmt, ... ) fwritemsg( __FILE__, __LINE__, __FUNCTION__, pan,   f,    fmt, ## __VA_ARGS__ )
      |                                                                                                  ^~~
../msgenu.h:108:36: note: in expansion of macro ‘PWRITEMSG’
  108 | #define  LOGMSG(      fmt,   ... ) PWRITEMSG(  WRMSG_NORMAL,       fmt,                 ## __VA_ARGS__ )
      |                                    ^~~~~~~~~
../msgenu.h:110:36: note: in expansion of macro ‘LOGMSG’
  110 | #define  WRMSG(     id, sev, ... ) LOGMSG(                      #id "%s " id "\n", sev, ## __VA_ARGS__ )
      |                                    ^~~~~~
../cpu.c:1875:17: note: in expansion of macro ‘WRMSG’
 1875 |                 WRMSG( HHC00826, "W", PTYPSTR( sysblk.pcpu ),
      |                 ^~~~~
../cpu.c: In function ‘z900_process_interrupt’:
../cpu.c:1876:29: warning: format ‘%X’ expects argument of type ‘unsigned int’, but argument 9 has type ‘char *’ [-Wformat=]
 1876 |                     "auto-" );
      |                     ~~~~~~~ ^
      |                     |
      |                     char *
../msgenu.h:99:98: note: in definition of macro ‘PFWRITEMSG’
   99 | #define PFWRITEMSG( pan, f, fmt, ... ) fwritemsg( __FILE__, __LINE__, __FUNCTION__, pan,   f,    fmt, ## __VA_ARGS__ )
      |                                                                                                  ^~~
../msgenu.h:108:36: note: in expansion of macro ‘PWRITEMSG’
  108 | #define  LOGMSG(      fmt,   ... ) PWRITEMSG(  WRMSG_NORMAL,       fmt,                 ## __VA_ARGS__ )
      |                                    ^~~~~~~~~
../msgenu.h:110:36: note: in expansion of macro ‘LOGMSG’
  110 | #define  WRMSG(     id, sev, ... ) LOGMSG(                      #id "%s " id "\n", sev, ## __VA_ARGS__ )
      |                                    ^~~~~~
../cpu.c:1875:17: note: in expansion of macro ‘WRMSG’
 1875 |                 WRMSG( HHC00826, "W", PTYPSTR( sysblk.pcpu ),
      |                 ^~~~~
../cpu.c:1876:29: warning: format ‘%s’ expects a matching ‘char *’ argument [-Wformat=]
 1876 |                     "auto-" );
      |                             ^
../msgenu.h:99:98: note: in definition of macro ‘PFWRITEMSG’
   99 | #define PFWRITEMSG( pan, f, fmt, ... ) fwritemsg( __FILE__, __LINE__, __FUNCTION__, pan,   f,    fmt, ## __VA_ARGS__ )
      |                                                                                                  ^~~
../msgenu.h:108:36: note: in expansion of macro ‘PWRITEMSG’
  108 | #define  LOGMSG(      fmt,   ... ) PWRITEMSG(  WRMSG_NORMAL,       fmt,                 ## __VA_ARGS__ )
      |                                    ^~~~~~~~~
../msgenu.h:110:36: note: in expansion of macro ‘LOGMSG’
  110 | #define  WRMSG(     id, sev, ... ) LOGMSG(                      #id "%s " id "\n", sev, ## __VA_ARGS__ )
      |                                    ^~~~~~
../cpu.c:1875:17: note: in expansion of macro ‘WRMSG’
 1875 |                 WRMSG( HHC00826, "W", PTYPSTR( sysblk.pcpu ),
      |                 ^~~~~

from hyperion.

Fish-Git avatar Fish-Git commented on August 23, 2024

Fix(es) committed. Please try again.

from hyperion.

wrljet avatar wrljet commented on August 23, 2024

Fish,

That worked! Good work!

The only one I see now on that system is this (which I think we've seen before):

  CC       ckddasd.lo
../ckddasd.c: In function ‘PerformSubsystemFunction.constprop’:
../ckddasd.c:6016:9: warning: ‘orig_iobuf’ may be used uninitialized [-Wmaybe-uninitialized]
 6016 |         memmove( &orig_iobuf[0], &iobuf[0], dev->ckdssdlen );
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../ckddasd.c:5661:12: note: ‘orig_iobuf’ was declared here
 5661 |     BYTE*  orig_iobuf;
      |            ^~~~~~~~~~

Bill

from hyperion.

Fish-Git avatar Fish-Git commented on August 23, 2024

The only one I see now on that system is this (which I think we've seen before):

That's supposed to have been fixed by commit 873c8ba!  (And yes, I tested it. Both before the fix and again afterwards.)

What version of gcc are you using? Because as committed, the above fix (workaround) should apply to any gcc version > 11. Maybe we need to change it to some earlier version?

from hyperion.

wrljet avatar wrljet commented on August 23, 2024

gcc 12.2

The diff for the commit you've mentioned shows some lines that to me look unchanged, for what it's worth.

from hyperion.

Fish-Git avatar Fish-Git commented on August 23, 2024

The diff for the commit you've mentioned shows some lines that to me look unchanged, for what it's worth.

Really? Because that commit SHOULD show that for gcc >= 11.0.0, the "-Wmaybe-uninitialized" warning is being disabled:

  • hyperion/ckddasd.c

    Lines 6753 to 6756 in a17d394

    #if defined( GCC_VERSION ) && GCC_VERSION >= 110000 /* gcc >= 11.0.0 */
    PUSH_GCC_WARNINGS()
    DISABLE_GCC_WARNING( "-Wmaybe-uninitialized" )
    #endif
  • hyperion/ckddasd.c

    Lines 6998 to 7000 in a17d394

    #if defined( GCC_VERSION ) && GCC_VERSION >= 110000 /* gcc >= 11.0.0 */
    POP_GCC_WARNINGS()
    #endif

from hyperion.

wrljet avatar wrljet commented on August 23, 2024

Fish,

The warning is for lines outside the range being protected.

You're guarding lines 6755 - 6999, and the warnings are at 5661 and 6016..

  CC       ckddasd.lo
../ckddasd.c: In function ‘PerformSubsystemFunction.constprop’:
../ckddasd.c:6016:9: warning: ‘orig_iobuf’ may be used uninitialized [-Wmaybe-uninitialized]
 6016 |         memmove( &orig_iobuf[0], &iobuf[0], dev->ckdssdlen );
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../ckddasd.c:5661:12: note: ‘orig_iobuf’ was declared here
 5661 |     BYTE*  orig_iobuf;
      |            ^~~~~~~~~~

from hyperion.

Fish-Git avatar Fish-Git commented on August 23, 2024

You're guarding lines 6755 - 6999, and the warnings are at 5661 and 6016..

(Oops!) I missed that the first time. Sorry. I'll get that fixed right away. It's the same fix, I just need to wrap it around the PerformSubsystemFunction too. Give me a minute.

from hyperion.

Fish-Git avatar Fish-Git commented on August 23, 2024

Should be fixed now by commit 23c8c46.

from hyperion.

wrljet avatar wrljet commented on August 23, 2024

Should be fixed now by commit 23c8c46.

Verified -- fixed now.

from hyperion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.