Have fun setting up OpenVPN tray icon, sucker



  • @dcon said:

    Except you have to go look up what that -W string is when it happens[1]. In VC, I see the warning number when compiling, copy/paste, done. (I usually copy/paste the warning text too so I don't have to remember.)

    gcc --help -v 2>&1 | grep \-W (Which is admittelly slightly fiddlier than it needs to be because gcc dumps it's help to stderr...)



  • @tar said:

    gcc --help -v 2>&1 | grep -W (Which is admittelly slightly fiddlier than it needs to be because gcc dumps it's help to stderr...)

    VC for the win.



  • CL doesn't even have documentation built in for its warnings. What are you going to do if you're trying to fix your code on a plane, where you don't have internet, eh?



  • The process described is very similar to building Boost with GCC on Windows.


  • BINNED

    @tar said:

    What are you going to do if you're trying to fix your code on a plane, where you don't have internet, eh?

    Get a life?

    Yeah, yeah, look who's talking etc.



  • "I need to be able to work on a plane" is often advanced as a reason that you need to use git for source control.

    Of course, the obvious response to this is "no you don't, that's stupid. You're stupid, and your source control is stupid also..."


  • BINNED

    @tar said:

    "I need to be able to work on a plane" is often advanced as a reason that you are a git

    Yes.


  • Discourse touched me in a no-no place

    @tar said:

    OK, now you've actually made me think about it, I think the GCC #pragma has a slight edge on the CL #pragma because you don't have to go on the internet to look up the warning code to see what's being disabled. So that's an advantage which mitigates it being longer...

    TDEMSYR. You'd only be turning off a warning because you already had it, so you'd already know what the number was.


  • Discourse touched me in a no-no place

    @tar said:

    What are you going to do if you're trying to fix your code on a plane, where you don't have internet, eh?

    If I were foolish enough to do that I'd've installed the offline help.

    The one-line messages that come with the number are frequently enough to go on. For example, 4700 above is, IIRC, "use of uninitialized variable" which I happen to remember because it was listed on the MSDN page describing the #pragma syntax.



  • @FrostCat said:

    TDEMSYR. You'd only be turning off a warning because you already had it, so you'd already know what the number was.

    That's right, because maintenance isn't a thing. Any code I would ever look at would have been written by me. undefined



  • Alright fine, the CL #pragmas are better than the GCC #pragmas in every respect.

    Even Discourse agrees:


  • Discourse touched me in a no-no place

    @tar said:

    That's right, because maintenance isn't a thing. Any code I would ever look at would have been written by me.

    #include <iostream>
    
    using namespace std;
    
    void main()
    {
        int i;
    
        cout << i << endl;
    }
    
    D:\Temp>cl /EHsc s.cpp
    Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    s.cpp
    d:\temp\s.cpp(9) : warning C4700: uninitialized local variable 'i' used
    Microsoft (R) Incremental Linker Version 12.00.31101.0
    Copyright (C) Microsoft Corporation.  All rights reserved.
    
    /out:s.exe
    s.obj
    
    D:\Temp>
    

    What's that?

    d:\temp\s.cpp(9) : warning C4700: uninitialized local variable 'i' used
    

    Ooh, a description of the warning along with the number. Besides, the person before you probably already disabled it. If you really wanted to know, you could temporarily turn the warning back on.


  • Discourse touched me in a no-no place

    @tar said:

    Alright fine, the CL #pragmas are better than the GCC #pragmas in every respect.

    Victory is mine!



  • My point being, if I unearth something while I'm looking through some dark and forgotten corner of some dusty corporate codebase, and it's sprinkled with #pragma warning disables, those warning numbers aren't necessarily going to mean a lot to me without needing to go off and do some further research (or comment out the pragmas and see what happens, but if I do that and there's still no warning, then I'm none the wiser as to the original programmer's intent...)

    With #pragma GCC diagnostic ignored "-Winvalid-offsetof", I can at least guess what that's trying to do (and then have a look for offsetofs in the code...)



  • @tar said:

    gcc --help -v 2>&1 | grep \-W

    yields:

    $ gcc --help -v 2>&1 | grep \-W
    grep: invalid option -- 'W'
    Usage: grep [OPTION]... PATTERN [FILE]...
    Try 'grep --help' for more information.
    

    This works though:

    $ gcc --help -v 2>&1 | grep -- -W
      -Wa,<options>            Pass comma-separated <options> on to the assembler
      -Wp,<options>            Pass comma-separated <options> on to the preprocessor
      -Wl,<options>            Pass comma-separated <options> on to the linker
    Options starting with -g, -f, -m, -O, -W, or --param are automatically
     other options on to these processes the -W<letter> options must be used.
     /usr/lib/gcc/x86_64-linux-gnu/4.8/cc1 -quiet -v -imultiarch x86_64-linux-gnu help-dummy -quiet -dumpbase help-dummy -mtune=generic -march=x86-64 -auxbase help-dummy -version --help -fstack-protector -Wformat -Wformat-security -o /tmp/cceGrIxu.s
      -Wcast-result               Warn about casts that will produce a null or nil
      -Waliasing                  Warn about possible aliasing of dummy arguments
      -Walign-commons             Warn about alignment of COMMON blocks
      -Wampersand                 Warn about missing ampersand in continued
    [...]
    

  • area_deu

    @tar said:


    What. The. Fuck.



  • @tar said:

    What are you going to do if you're trying to fix your code on a plane, where you don't have internet, eh?

    As long as you weren't fixing python on the motherfucking plane, it should all be OK.



  • Yup.



  • Timely joke. That movie is just at the cusp of public awareness.



  • You're wrong.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.