Uploaded image for project: 'Support'
  1. Support
  2. SUPPORT-188

Build warnings with isXXXX() function/macros

    XMLWordPrintable

    Details

    • Type: Support
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: OpenDNSSEC 2.0
    • Fix Version/s: None
    • Component/s: Build
    • Labels:
      None
    • Environment:

      NetBSD/amd64 6.1.5, gcc 4.5.3
      OpenDNSSEC 1.4.9

      Description

      Hi,

      the build of OpenDNSSEC 1.4.9 produces a few warnings in the build log:

      strlcat.c:63:0: warning: ISO C forbids an empty translation unit
      strlcpy.c:59:0: warning: ISO C forbids an empty translation unit
      b64_pton.c:154:3: warning: array subscript has type 'char'
      libhsm.c:296:28: warning: ISO C forbids conversion of object pointer to function pointer type
      datetime.c:687:9: warning: array subscript has type 'char'
      string_util2.c:599:13: warning: array subscript has type 'char'

      I'll let you folks deal with the libhsm.c warning. It seems to be difficult
      to deal with, CK_C_GetFunctionList appears to be declared as a function
      pointer, and dlsym() returns void*.

      The "no empty translation unit" is probably because this platform has
      the associated functions natively.

      However, the last class can be potentially nasty/unportable:
      the isXXXX() macros/functions only accept the value range of
      unsigned char and -1 (or EOF? I forget) as arguments, and anything
      else results in undefined behavior if I recall correctly.

      On most platforms, "char" is actually "signed char" and can take
      values outside of the domain for these functions.

      Therefore: as long as EOF is dealt with, the proper way to deal with
      these is either to use "unsigned char" as variable type, or cast the
      arguments to the isXXXX() functions/macros to "unsigned char".

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            he HÃ¥vard Eidnes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: