Skip to content
Tcl Source Code History Of Ticket 8065d178229d8d33
Login

History Of Ticket 8065d178229d8d33

Artifacts Associated With Ticket 8065d178229d8d33

  1. Ticket change [6972fd1e3f] (rid 141543) by erikleunissen on 2015-04-14 20:47:21:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      When a unix build is configured with --disable-symbols, the NDEBUG preprocessor directive occurs twice in the compiler command. This indicates cluttered logic somewhere upstream.
      
      This patch proposes to resolve the clutter through removal of a specific assignment of this directive in the file unix/tcl.m4.
      
      An analysis[*] of tcl.m4 and Makefile.in (fossil trunk) led to the following:
      - The preprocessor directive NDEBUG is assigned to two different variables, introducing two separate processing paths by which it propagates through the code.
      - (luckily) These two assignments occur relatively far apart in the code, in different files (Makefile.in and tcl.m4)
      - These two different processing paths are not (yet) intermingled. They are separately leading to a duplication in the compiler command. The reason is that the two assignments are done under the same conceptual conditions (optimization and --disable-symbols).
      
      Other considerations:
      - -DNDEBUG doesn't merit its place as a part of CFLAGS_OPTIMIZE. It's not an optimization flag for the C compiler; it's a preprocessor directive. The assignment to DEFS through AC_DEFINE() in tcl.m4 is the appropriate way.
      - The still separate propagation paths leave us with a promise of a simple remedy: eliminating one of these propagations, before more clutter is being introduced on top if it.
      
      The attached patch removes the assignment of the NDEBUG preprocessor directive from CFLAGS_OPTIMIZE (Makefile.in). This ticket is in line with patch ticket bc16203b0e.
      
      Sincerely,
      
      Erik Leunissen
      --
      [*] Analysis details:
      
      Commit history in fossil (trunk):
      1. artifact [00503f3b97] introduces -DNDEBUG as an assignment to CFLAGS_OPTIMIZE in unix/Makefile.in (2009-07-18)
      2. artifact [c0abbe2663] introduces -DNDEBUG as an assignment to DEFS through AC_DEFINE() in unix/tcl.m4 (2012-04-11)
      
      1. The code path w.r.t. assignment to CFLAGS_OPTIMIZE:
      - _DNDEBUG is assigned to CFLAGS_OPTIMIZE unconditionally
      - CFLAGS_DEFAULT equals CFLAGS_OPTIMIZE only if ./configured with --disable-symbols (tcl.m4)
      - CFLAGS_OPTIMIZE is never assigned to another variable than CFLAGS_DEFAULT (tcl.m4)
      - CFLAGS_DEFAULT is never assigned to another variable than CFLAGS (Makefile.in)
      
      2. The code path w.r.t. assignment to DEFS:
      - -DNDEBUG is assigned to DEFS only if ./configured with --disable-symbols (tcl.m4)
      - DEFS == AC_CFLAGS (Makefile.in)
      
      3. The two code paths join:
      The compiler commands composed by Makefile.in, use variables (like CC_SWITCHES) that are composed of both AC_FLAGS and CFLAGS, without exception. This makes that the compiler commands, if they contain -DNDEBUG, they always end up having it twice, supplied by two different code paths.
      
      -- end of message --
      
    5. foundin initialized to: "trunk"
    6. is_private initialized to: "0"
    7. login: "erikleunissen"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "609f4c7ecf7dbb7a46acdc7eb164753d196088a6"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "erikleunissen"
    14. subsystem initialized to: "53. Configure and Build Tools"
    15. title initialized to:
      Duplicate -DNDEBUG in compiler command with --disable-symbols
      
    16. type initialized to: "Bug"
  2. Add attachment "tcl.trunk.patch" [3cd32b4079] (rid 141544) by erikleunissen on 2015-04-14 20:47:46.

  3. Ticket change [b282f348fd] (rid 141545) by erikleunissen on 2015-04-14 20:50:40:

    1. comment changed to:
      When a unix build is configured with --disable-symbols, the NDEBUG preprocessor directive occurs twice in the compiler command. This indicates cluttered logic somewhere upstream.
      
      This patch proposes to resolve the clutter through removal of a specific assignment of this directive in the file unix/tcl.m4.
      
      An analysis[*] of tcl.m4 and Makefile.in (fossil trunk) led to the following:
      - The preprocessor directive NDEBUG is assigned to two different variables, introducing two separate processing paths by which it propagates through the code.
      - These two assignments occur relatively far apart in the code, in different files (Makefile.in and tcl.m4)
      - (luckily) These two different processing paths are not (yet) intermingled. They are separately leading to a duplication in the compiler command. The reason is that the two assignments are done under the same conceptual conditions (optimization and --disable-symbols).
      
      Other considerations:
      - -DNDEBUG doesn't merit its place as a part of CFLAGS_OPTIMIZE. It's not an optimization flag for the C compiler; it's a preprocessor directive. The assignment to DEFS through AC_DEFINE() in tcl.m4 is the appropriate way.
      - The still separate propagation paths leave us with a promise of a simple remedy: eliminating one of these propagations, before more clutter is being introduced on top if it.
      
      The attached patch removes the assignment of the NDEBUG preprocessor directive from CFLAGS_OPTIMIZE (Makefile.in). This ticket is in line with patch ticket bc16203b0e.
      
      Sincerely,
      
      Erik Leunissen
      --
      [*] Analysis details:
      
      Commit history in fossil (trunk):
      1. artifact [00503f3b97] introduces -DNDEBUG as an assignment to CFLAGS_OPTIMIZE in unix/Makefile.in (2009-07-18)
      2. artifact [c0abbe2663] introduces -DNDEBUG as an assignment to DEFS through AC_DEFINE() in unix/tcl.m4 (2012-04-11)
      
      1. The code path w.r.t. assignment to CFLAGS_OPTIMIZE:
      - _DNDEBUG is assigned to CFLAGS_OPTIMIZE unconditionally
      - CFLAGS_DEFAULT equals CFLAGS_OPTIMIZE only if ./configured with --disable-symbols (tcl.m4)
      - CFLAGS_OPTIMIZE is never assigned to another variable than CFLAGS_DEFAULT (tcl.m4)
      - CFLAGS_DEFAULT is never assigned to another variable than CFLAGS (Makefile.in)
      
      2. The code path w.r.t. assignment to DEFS:
      - -DNDEBUG is assigned to DEFS only if ./configured with --disable-symbols (tcl.m4)
      - DEFS == AC_CFLAGS (Makefile.in)
      
      3. The two code paths join:
      The compiler commands composed by Makefile.in, use variables (like CC_SWITCHES) that are composed of both AC_FLAGS and CFLAGS, without exception. This makes that the compiler commands, if they contain -DNDEBUG, they always end up having it twice, supplied by two different code paths.
      
      -- end of message --
      
    2. login: "erikleunissen"
    3. mimetype: "text/plain"
  4. Ticket change [7581ce7351] (rid 141546) by erikleunissen on 2015-04-14 20:51:33:

    1. comment changed to:
      When a unix build is configured with --disable-symbols, the NDEBUG preprocessor directive occurs twice in the compiler command. This indicates cluttered logic somewhere upstream.
      
      This patch proposes to resolve the clutter through removal of a specific assignment of this directive in the file unix/Makefile.in.
      
      An analysis[*] of tcl.m4 and Makefile.in (fossil trunk) led to the following:
      - The preprocessor directive NDEBUG is assigned to two different variables, introducing two separate processing paths by which it propagates through the code.
      - These two assignments occur relatively far apart in the code, in different files (Makefile.in and tcl.m4)
      - (luckily) These two different processing paths are not (yet) intermingled. They are separately leading to a duplication in the compiler command. The reason is that the two assignments are done under the same conceptual conditions (optimization and --disable-symbols).
      
      Other considerations:
      - -DNDEBUG doesn't merit its place as a part of CFLAGS_OPTIMIZE. It's not an optimization flag for the C compiler; it's a preprocessor directive. The assignment to DEFS through AC_DEFINE() in tcl.m4 is the appropriate way.
      - The still separate propagation paths leave us with a promise of a simple remedy: eliminating one of these propagations, before more clutter is being introduced on top if it.
      
      The attached patch removes the assignment of the NDEBUG preprocessor directive from CFLAGS_OPTIMIZE (Makefile.in). This ticket is in line with patch ticket bc16203b0e.
      
      Sincerely,
      
      Erik Leunissen
      --
      [*] Analysis details:
      
      Commit history in fossil (trunk):
      1. artifact [00503f3b97] introduces -DNDEBUG as an assignment to CFLAGS_OPTIMIZE in unix/Makefile.in (2009-07-18)
      2. artifact [c0abbe2663] introduces -DNDEBUG as an assignment to DEFS through AC_DEFINE() in unix/tcl.m4 (2012-04-11)
      
      1. The code path w.r.t. assignment to CFLAGS_OPTIMIZE:
      - _DNDEBUG is assigned to CFLAGS_OPTIMIZE unconditionally
      - CFLAGS_DEFAULT equals CFLAGS_OPTIMIZE only if ./configured with --disable-symbols (tcl.m4)
      - CFLAGS_OPTIMIZE is never assigned to another variable than CFLAGS_DEFAULT (tcl.m4)
      - CFLAGS_DEFAULT is never assigned to another variable than CFLAGS (Makefile.in)
      
      2. The code path w.r.t. assignment to DEFS:
      - -DNDEBUG is assigned to DEFS only if ./configured with --disable-symbols (tcl.m4)
      - DEFS == AC_CFLAGS (Makefile.in)
      
      3. The two code paths join:
      The compiler commands composed by Makefile.in, use variables (like CC_SWITCHES) that are composed of both AC_FLAGS and CFLAGS, without exception. This makes that the compiler commands, if they contain -DNDEBUG, they always end up having it twice, supplied by two different code paths.
      
      -- end of message --
      
    2. login: "erikleunissen"
    3. mimetype: "text/plain"
  5. Ticket change [cc4f6dfb76] (rid 141577) by jan.nijtmans on 2015-04-20 11:21:40:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2457132.97338212"
    3. closer changed to: "jan.nijtmans"
    4. icomment:
      Fixed in: [0a2e3bb2d9434f88]. Thanks for this report, fully agreed on this analysis!
      
    5. login: "jan.nijtmans"
    6. mimetype: "text/x-fossil-wiki"
    7. resolution changed to: "Fixed"
    8. status changed to: "Closed"