1. 16 Apr, 2020 2 commits
  2. 15 Apr, 2020 17 commits
    • Ondřej Surý's avatar
    • Ondřej Surý's avatar
    • Ondřej Surý's avatar
      Disable MSB8028 warning · b6c2012d
      Ondřej Surý authored
      All our MSVS Project files share the same intermediate directory.  We
      know that this doesn't cause any problems, so we can just disable the
      detection in the project files.
      
      Example of the warning:
      
        warning MSB8028: The intermediate directory (.\Release\) contains files shared from another project (dnssectool.vcxproj).  This can lead to incorrect clean and rebuild behavior.
      b6c2012d
    • Ondřej Surý's avatar
      Fix the discrepancy between cfg_pluginlist_foreach declaration and definition · 4ffe7255
      Ondřej Surý authored
      There was a missing indirection for the pluginlist_cb_t *callback in the
      declaration of the cfg_pluginlist_foreach function.  Reported by MSVC as:
      
        lib\isccfg\parser.c(4057): warning C4028: formal parameter 4 different from declaration
      4ffe7255
    • Ondřej Surý's avatar
      Workaround MSVC warning C4477 · 60c632ab
      Ondřej Surý authored
      Due to a way the stdatomic.h shim is implemented on Windows, the MSVC
      always things that the outside type is the largest - atomic_(u)int_fast64_t.
      This can lead to false positives as this one:
      
        lib\dns\adb.c(3678): warning C4477: 'fprintf' : format string '%u' requires an argument of type 'unsigned int', but variadic argument 2 has type 'unsigned __int64'
      
      We workaround the issue by loading the value in a scoped local variable
      with correct type first.
      60c632ab
    • Ondřej Surý's avatar
      Disable C4090 MSVC warning · 063e0549
      Ondřej Surý authored
      MSVC documentation states: "This warning can be caused when a pointer to
      a const or volatile item is assigned to a pointer not declared as
      pointing to const or volatile."
      
      Unfortunately, this happens when we dynamically allocate and deallocate
      block of atomic variables using isc_mem_get and isc_mem_put.
      
      Couple of examples:
      
        lib\isc\hp.c(134): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
        lib\isc\hp.c(144): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
        lib\isc\stats.c(55): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
        lib\isc\stats.c(87): warning C4090: 'function': different 'volatile' qualifiers [C:\builds\isc-projects\bind9\lib\isc\win32\libisc.vcxproj]
      063e0549
    • Ondřej Surý's avatar
      Fix invalid cast in win32 stdatomic.h shim · 54168d55
      Ondřej Surý authored
      The InterlockedOr8() and InterlockedAnd8() first argument was cast
      to (atomic_int_fast8_t) instead of (atomic_int_fast8_t *), this was
      reported by MSVC as:
      
        warning C4024: '_InterlockedOr8': different types for formal and actual parameter 1
        warning C4024: '_InterlockedAnd8': different types for formal and actual parameter 1
      54168d55
    • Ondřej Surý's avatar
    • Ondřej Surý's avatar
      b1f66d1e
    • Ondřej Surý's avatar
    • Ondřej Surý's avatar
      Don't return from void function · 948a23e6
      Ondřej Surý authored
      948a23e6
    • Ondřej Surý's avatar
      Set WarningLevel to Level1 for Release, treat warnings as errors · 789d253e
      Ondřej Surý authored
      Our vcxproj files set the WarningLevel to Level3, which is too verbose
      for a code that needs to be portable.  That basically leads to ignoring
      all the errors that MSVC produces.  This commits downgrades the
      WarningLevel to Level1 and enables treating warnings as errors for
      Release builds.  For the Debug builds the WarningLevel got upgraded to
      Level4, and treating warnings as errors is explicitly disabled.
      
      We should eventually make the code clean of all MSVC warnings, but it's
      a long way to go for Level4, so it's more reasonable to start at Level1.
      
      For reference[1], these are the warning levels as described by MSVC
      documentation:
      
        * /W0 suppresses all warnings. It's equivalent to /w.
        * /W1 displays level 1 (severe) warnings. /W1 is the default setting
          in the command-line compiler.
        * /W2 displays level 1 and level 2 (significant) warnings.
        * /W3 displays level 1, level 2, and level 3 (production quality)
          warnings. /W3 is the default setting in the IDE.
        * /W4 displays level 1, level 2, and level 3 warnings, and all level 4
          (informational) warnings that aren't off by default. We recommend
          that you use this option to provide lint-like warnings. For a new
          project, it may be best to use /W4 in all compilations. This option
          helps ensure the fewest possible hard-to-find code defects.
        * /Wall displays all warnings displayed by /W4 and all other warnings
          that /W4 doesn't include — for example, warnings that are off by
          default.
        * /WX treats all compiler warnings as errors. For a new project, it
          may be best to use /WX in all compilations; resolving all warnings
          ensures the fewest possible hard-to-find code defects.
      
      1. https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=vs-2019
      789d253e
    • Michał Kępień's avatar
      Merge branch 'michal/fix-srcid-on-windows' into 'master' · 4f2b3799
      Michał Kępień authored
      Fix "srcid" on Windows
      
      See merge request !3364
      4f2b3799
    • Michał Kępień's avatar
      Fix "srcid" on Windows · 05e13e7c
      Michał Kępień authored
      Windows BIND releases produced by GitLab CI are built from Git
      repositories, not from release tarballs, which means the "srcid" file is
      not present in the top source directory when MSBuild is invoked.  This
      causes the Git commit hash for such builds to be set to "unset_id".
      Enable win32utils/Configure to try determining the commit hash for a
      build by invoking Git on the build host if the "srcid" file is not
      present (which is what its Unix counterpart does).
      05e13e7c
    • Ondřej Surý's avatar
      Merge branch 'ondrej/add-missing-time.h-on-win32' into 'master' · 8a24be07
      Ondřej Surý authored
      Add missing time.h header in windows isc/time.h for missing prototypes
      
      See merge request !3368
      8a24be07
    • Ondřej Surý's avatar
      Add missing time.h header in windows isc/time.h for missing prototypes · b9f68d09
      Ondřej Surý authored
      The win32 isc/time.h was missing <time.h> header leading to:
      
          lib\isc\win32\include\isc\time.h(29): warning C4013: 'gmtime_s'
          undefined; assuming extern returning int (compiling source file
          ..\app.c) [lib\isc\win32\libisc.vcxproj]
      
          lib\isc\win32\include\isc\time.h(39): warning C4013: 'localtime_s'
          undefined; assuming extern returning int (compiling source file
          ..\app.c) [lib\isc\win32\libisc.vcxproj]
      b9f68d09
    • Ondřej Surý's avatar
      Merge branch 'ondrej/add-python-static-analysis-to-gitlab-ci' into 'master' · c87ce5a4
      Ondřej Surý authored
      Add python static analysis to GitLab CI
      
      See merge request !3311
      c87ce5a4
  3. 14 Apr, 2020 2 commits
  4. 09 Apr, 2020 1 commit
  5. 08 Apr, 2020 18 commits