Nim generates unreadable C code. C warnings are for human written code.

It makes no sense to apply C warning meant for humans to auto generated C code. 
Nim already checks that the construct makes sense before passing it to C. It 
makes no sense to check it in C again. C warnings for Nim code are mostly 
meaningless. Nim will generate "unsafe" C code because it checked for it safety 
at the Nim level.

Look look at the code that generates the warnings:
    
    
    when defined(windows) and not defined(nimscript) and not defined(js):
      # work-around C's sucking abstraction:
      # BUGFIX: stdin and stdout should be binary files!
      proc c_setmode(handle, mode: cint) {.
        importc: when defined(bcc): "setmode" else: "_setmode",
        header: "<io.h>".}
      var
        O_BINARY {.importc: "_O_BINARY", header: "<fcntl.h>".}: cint
      
      # we use binary mode on Windows:
      c_setmode(c_fileno(stdin), O_BINARY)
      c_setmode(c_fileno(stdout), O_BINARY)
      c_setmode(c_fileno(stderr), O_BINARY)
    
    
    Run

It's just a work around a "bug" in windows related to binary input streams.

Look at Nim warnings not C warnings. 

Reply via email to