Menu

warning: type specifier missing, defaults to 'int'

2024-08-08
2024-10-27
  • Ryan Carsten Schmidt

    These warnings occur when compiling vtwm 5.5.0 on macOS 12 with Apple Clang 14:

    add_window.c:460:12: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
        static lastwingroup = 0;
        ~~~~~~ ^
    add_window.c:461:12: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
        static lastwin = 0;
        ~~~~~~ ^
    add_window.c:462:12: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
        static lasttime = 0;
        ~~~~~~ ^
    
     
  • Ryan Carsten Schmidt

    Newer compilers like llvm.org clang 18 consider this to be an error, not a warning:

    add_window.c:460:12: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
      460 |     static lastwingroup = 0;
          |     ~~~~~~ ^
          |     int
    add_window.c:461:12: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
      461 |     static lastwin = 0;
          |     ~~~~~~ ^
          |     int
    add_window.c:462:12: error: type specifier missing, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
      462 |     static lasttime = 0;
          |     ~~~~~~ ^
          |     int
    

    To fix it, add int after each static.

     
  • Callum Gibson

    Callum Gibson - 2024-10-27

    fixed

     

Log in to post a comment.

MongoDB Logo MongoDB