<i>Duplicate -DNDEBUG in compiler command with --disable-symbols</i> status still Open with 3 other changes
by
.
D 2015-04-14T20:50:40.663
J comment When\sa\sunix\sbuild\sis\sconfigured\swith\s--disable-symbols,\sthe\sNDEBUG\spreprocessor\sdirective\soccurs\stwice\sin\sthe\scompiler\scommand.\sThis\sindicates\scluttered\slogic\ssomewhere\supstream.\r\n\r\nThis\spatch\sproposes\sto\sresolve\sthe\sclutter\sthrough\sremoval\sof\sa\sspecific\sassignment\sof\sthis\sdirective\sin\sthe\sfile\sunix/tcl.m4.\r\n\r\nAn\sanalysis[*]\sof\stcl.m4\sand\sMakefile.in\s(fossil\strunk)\sled\sto\sthe\sfollowing:\r\n-\sThe\spreprocessor\sdirective\sNDEBUG\sis\sassigned\sto\stwo\sdifferent\svariables,\sintroducing\stwo\sseparate\sprocessing\spaths\sby\swhich\sit\spropagates\sthrough\sthe\scode.\r\n-\sThese\stwo\sassignments\soccur\srelatively\sfar\sapart\sin\sthe\scode,\sin\sdifferent\sfiles\s(Makefile.in\sand\stcl.m4)\r\n-\s(luckily)\sThese\stwo\sdifferent\sprocessing\spaths\sare\snot\s(yet)\sintermingled.\sThey\sare\sseparately\sleading\sto\sa\sduplication\sin\sthe\scompiler\scommand.\sThe\sreason\sis\sthat\sthe\stwo\sassignments\sare\sdone\sunder\sthe\ssame\sconceptual\sconditions\s(optimization\sand\s--disable-symbols).\r\n\r\nOther\sconsiderations:\r\n-\s-DNDEBUG\sdoesn't\smerit\sits\splace\sas\sa\spart\sof\sCFLAGS_OPTIMIZE.\sIt's\snot\san\soptimization\sflag\sfor\sthe\sC\scompiler;\sit's\sa\spreprocessor\sdirective.\sThe\sassignment\sto\sDEFS\sthrough\sAC_DEFINE()\sin\stcl.m4\sis\sthe\sappropriate\sway.\r\n-\sThe\sstill\sseparate\spropagation\spaths\sleave\sus\swith\sa\spromise\sof\sa\ssimple\sremedy:\seliminating\sone\sof\sthese\spropagations,\sbefore\smore\sclutter\sis\sbeing\sintroduced\son\stop\sif\sit.\r\n\r\nThe\sattached\spatch\sremoves\sthe\sassignment\sof\sthe\sNDEBUG\spreprocessor\sdirective\sfrom\sCFLAGS_OPTIMIZE\s(Makefile.in).\sThis\sticket\sis\sin\sline\swith\spatch\sticket\sbc16203b0e.\r\n\r\nSincerely,\r\n\r\nErik\sLeunissen\r\n--\r\n[*]\sAnalysis\sdetails:\r\n\r\nCommit\shistory\sin\sfossil\s(trunk):\r\n1.\sartifact\s[00503f3b97]\sintroduces\s-DNDEBUG\sas\san\sassignment\sto\sCFLAGS_OPTIMIZE\sin\sunix/Makefile.in\s(2009-07-18)\r\n2.\sartifact\s[c0abbe2663]\sintroduces\s-DNDEBUG\sas\san\sassignment\sto\sDEFS\sthrough\sAC_DEFINE()\sin\sunix/tcl.m4\s(2012-04-11)\r\n\r\n1.\sThe\scode\spath\sw.r.t.\sassignment\sto\sCFLAGS_OPTIMIZE:\r\n-\s_DNDEBUG\sis\sassigned\sto\sCFLAGS_OPTIMIZE\sunconditionally\r\n-\sCFLAGS_DEFAULT\sequals\sCFLAGS_OPTIMIZE\sonly\sif\s./configured\swith\s--disable-symbols\s(tcl.m4)\r\n-\sCFLAGS_OPTIMIZE\sis\snever\sassigned\sto\sanother\svariable\sthan\sCFLAGS_DEFAULT\s(tcl.m4)\r\n-\sCFLAGS_DEFAULT\sis\snever\sassigned\sto\sanother\svariable\sthan\sCFLAGS\s(Makefile.in)\r\n\r\n2.\sThe\scode\spath\sw.r.t.\sassignment\sto\sDEFS:\r\n-\s-DNDEBUG\sis\sassigned\sto\sDEFS\sonly\sif\s./configured\swith\s--disable-symbols\s(tcl.m4)\r\n-\sDEFS\s==\sAC_CFLAGS\s(Makefile.in)\r\n\r\n3.\sThe\stwo\scode\spaths\sjoin:\r\nThe\scompiler\scommands\scomposed\sby\sMakefile.in,\suse\svariables\s(like\sCC_SWITCHES)\sthat\sare\scomposed\sof\sboth\sAC_FLAGS\sand\sCFLAGS,\swithout\sexception.\sThis\smakes\sthat\sthe\scompiler\scommands,\sif\sthey\scontain\s-DNDEBUG,\sthey\salways\send\sup\shaving\sit\stwice,\ssupplied\sby\stwo\sdifferent\scode\spaths.\r\n\r\n--\send\sof\smessage\s--
J login erikleunissen
J mimetype text/plain
K 8065d178229d8d335eee64d36ada37c4dedf2579
U erikleunissen
Z 7b76e98f9af1e02da65c27c4b5da2197