{"thread":{"id":"50330","subject":"[PATCH] test-xml-encode: fix sparse NULL pointer warnings","startedAt":"2019-01-26T21:03:19Z","lastAt":"2019-01-29T02:23:21Z","messageCount":8,"participants":["Ramsay Jones","Johannes Schindelin","Jonathan Nieder","Luc Van Oostenryck"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"367717","messageId":"68a8c70e-dc42-1df3-3616-c096f63cb848@ramsayjones.plus.com","threadId":"50330","inReplyTo":null,"subject":"[PATCH] test-xml-encode: fix sparse NULL pointer warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2019-01-26T21:03:12Z","receivedAt":"2019-01-26T21:03:19Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n\nHi Johannes,\n\nIf you need to re-roll your 'js/vsts-ci' branch, could you please\nsquash this into the relevant patch (commit af7747e7c7 (\"tests: optionally\nwrite results as JUnit-style .xml\", 2019-01-23)).\n\nThanks!\n\nATB,\nRamsay Jones\n\n t/helper/test-xml-encode.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/helper/test-xml-encode.c b/t/helper/test-xml-encode.c\nindex 367c4875e6..a648bbd961 100644\n--- a/t/helper/test-xml-encode.c\n+++ b/t/helper/test-xml-encode.c\n@@ -26,7 +26,7 @@ int cmd__xml_encode(int argc, const char **argv)\n \t\tif (tmp2) {\n \t\t\tif ((ch & 0xc0) != 0x80) {\n \t\t\t\tfputs(utf8_replace_character, stdout);\n-\t\t\t\ttmp2 = 0;\n+\t\t\t\ttmp2 = NULL;\n \t\t\t\tcur--;\n \t\t\t\tcontinue;\n \t\t\t}\n@@ -34,7 +34,7 @@ int cmd__xml_encode(int argc, const char **argv)\n \t\t\ttmp2++;\n \t\t\tif (--remaining == 0) {\n \t\t\t\tfwrite(tmp, tmp2 - tmp, 1, stdout);\n-\t\t\t\ttmp2 = 0;\n+\t\t\t\ttmp2 = NULL;\n \t\t\t}\n \t\t\tcontinue;\n \t\t}\n-- \n2.20.0\n"},{"id":"367832","messageId":"nycvar.QRO.7.76.6.1901281706440.41@tvgsbejvaqbjf.bet","threadId":"50330","inReplyTo":"68a8c70e-dc42-1df3-3616-c096f63cb848@ramsayjones.plus.com","subject":"sparse job, was Re: [PATCH] test-xml-encode: fix sparse NULL pointer warnings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-01-28T16:10:09Z","receivedAt":"2019-01-28T16:10:36Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Ramsay,\n\nOn Sat, 26 Jan 2019, Ramsay Jones wrote:\n\n> \n> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n> ---\n> \n> Hi Johannes,\n> \n> If you need to re-roll your 'js/vsts-ci' branch, could you please\n> squash this into the relevant patch (commit af7747e7c7 (\"tests: optionally\n> write results as JUnit-style .xml\", 2019-01-23)).\n\nCertainly!\n\nBTW would you be interested in working with me on an Azure Pipeline that\nruns `sparse` on all of Junio's branches? (I am now pretty proficient with\nbuilding a software package in one Azure Pipeline, publishing it as a\nbuild artifact, then consuming it from another Azure Pipeline, so I would\nbuild the `sparse` package as an Ubuntu package and offer it as a build\nartifact.)\n\nI seem to recall that you once explained to me what it takes, but that\nmail vanished from my inbox and I cannot find it.\n\nThanks,\nDscho\n\n> \n> Thanks!\n> \n> ATB,\n> Ramsay Jones\n> \n>  t/helper/test-xml-encode.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/t/helper/test-xml-encode.c b/t/helper/test-xml-encode.c\n> index 367c4875e6..a648bbd961 100644\n> --- a/t/helper/test-xml-encode.c\n> +++ b/t/helper/test-xml-encode.c\n> @@ -26,7 +26,7 @@ int cmd__xml_encode(int argc, const char **argv)\n>  \t\tif (tmp2) {\n>  \t\t\tif ((ch & 0xc0) != 0x80) {\n>  \t\t\t\tfputs(utf8_replace_character, stdout);\n> -\t\t\t\ttmp2 = 0;\n> +\t\t\t\ttmp2 = NULL;\n>  \t\t\t\tcur--;\n>  \t\t\t\tcontinue;\n>  \t\t\t}\n> @@ -34,7 +34,7 @@ int cmd__xml_encode(int argc, const char **argv)\n>  \t\t\ttmp2++;\n>  \t\t\tif (--remaining == 0) {\n>  \t\t\t\tfwrite(tmp, tmp2 - tmp, 1, stdout);\n> -\t\t\t\ttmp2 = 0;\n> +\t\t\t\ttmp2 = NULL;\n>  \t\t\t}\n>  \t\t\tcontinue;\n>  \t\t}\n> -- \n> 2.20.0\n> \n"},{"id":"367863","messageId":"a6b689da-b002-0aa2-e9d6-755d004bc320@ramsayjones.plus.com","threadId":"50330","inReplyTo":"nycvar.QRO.7.76.6.1901281706440.41@tvgsbejvaqbjf.bet","subject":"Re: sparse job, was Re: [PATCH] test-xml-encode: fix sparse NULL pointer warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2019-01-28T20:13:03Z","receivedAt":"2019-01-28T20:13:11Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 28/01/2019 16:10, Johannes Schindelin wrote:\n> Hi Ramsay,\n> \n> On Sat, 26 Jan 2019, Ramsay Jones wrote:\n> \n>>\n>> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n>> ---\n>>\n>> Hi Johannes,\n>>\n>> If you need to re-roll your 'js/vsts-ci' branch, could you please\n>> squash this into the relevant patch (commit af7747e7c7 (\"tests: optionally\n>> write results as JUnit-style .xml\", 2019-01-23)).\n> \n> Certainly!\n> \n> BTW would you be interested in working with me on an Azure Pipeline that\n> runs `sparse` on all of Junio's branches? (I am now pretty proficient with\n> building a software package in one Azure Pipeline, publishing it as a\n> build artifact, then consuming it from another Azure Pipeline, so I would\n> build the `sparse` package as an Ubuntu package and offer it as a build\n> artifact.)\n\nHappy to help, if I can.\n\nLooking at the sparse wiki [1] we can see that the most recent\nrelease of sparse is v0.6.0, released on December 26th 2018\n(just too late for crimble!).  This is the release you will\nneed to use for more recent Linux distros (eg. fedora 27+,\nUbuntu 18.04, 18.10, etc).\n\nThe releases are available from [2] as a compressed tar-ball\nusing '.gz' or .'xz' compression. eg. sparse-0.6.0.tar.gz\n(there is also a sparse-0.6.0.tar.sign).\n\n[The git repo is at [3], BTW].\n\n[I was a little surprised that Linux Mint 19.1 (based on Ubuntu\n18.04) has v0.5.1 - Debian unstable has v0.5.2, but both of those\nare just a little too old for use with git on recent Linux.]\n\nIt seems Ubuntu has split sparse into two packages, the main\n'sparse' package, which contains the command-line programs and\na 'sparse-test-inspect' package, which contains the 'test-inspect'\nGUI program (and so depends on GTK).\n\nThe dependencies for the 'sparse' package includes: libc6 (>= 2.14),\nlibllvm4.0 (>= 1:4.0~), libxml2 (>= 2.7.4), perl:any\n\nHowever, for git, we only need to build 'cgcc' and 'sparse', which\nmeans we can forget about libxml (only used for c2xml), and libllvm\n(only used for sparse-llvm/sparsec/sparsei). Also, I'm not sure what\nperl is doing there ...\n\nNote that these dependencies (along with the dependent programs) are\noptional and I can happily build sparse without them:\n\n  $ make clean\n  Makefile:124: Your system does not have libxml, disabling c2xml\n  Makefile:146: Your system does not have gtk3/gtk2, disabling test-inspect\n  Makefile:179: Your system does not have llvm, disabling sparse-llvm\n    CLEAN\n  $ \n\nHmm, I've never built an Ubuntu package before, so I don't know\nexactly what would be required (spec file etc.) to create a PPA.\nBut I suspect you are not talking about doing that, right?\n\nATB,\nRamsay Jones\n\n[1] https://sparse.wiki.kernel.org/index.php/Main_Page\n[2] http://www.kernel.org/pub/software/devel/sparse/dist/\n[3] git://git.kernel.org/pub/scm/devel/sparse/sparse.git\n\n"},{"id":"367895","messageId":"nycvar.QRO.7.76.6.1901282333350.41@tvgsbejvaqbjf.bet","threadId":"50330","inReplyTo":"a6b689da-b002-0aa2-e9d6-755d004bc320@ramsayjones.plus.com","subject":"Re: sparse job, was Re: [PATCH] test-xml-encode: fix sparse NULL pointer warnings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2019-01-28T22:34:09Z","receivedAt":"2019-01-28T22:34:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Ramsay,\n\nOn Mon, 28 Jan 2019, Ramsay Jones wrote:\n\n> Hmm, I've never built an Ubuntu package before, so I don't know\n> exactly what would be required (spec file etc.) to create a PPA.\n> But I suspect you are not talking about doing that, right?\n\nI would have gone for `checkinstall`... That still works, right?\n\nCiao,\nDscho\n"},{"id":"367905","messageId":"ef5a8623-e5e6-5cc8-5178-0afce7b5499e@ramsayjones.plus.com","threadId":"50330","inReplyTo":"nycvar.QRO.7.76.6.1901282333350.41@tvgsbejvaqbjf.bet","subject":"Re: sparse job, was Re: [PATCH] test-xml-encode: fix sparse NULL pointer warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2019-01-29T00:02:14Z","receivedAt":"2019-01-29T00:02:21Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 28/01/2019 22:34, Johannes Schindelin wrote:\n> Hi Ramsay,\n> \n> On Mon, 28 Jan 2019, Ramsay Jones wrote:\n> \n>> Hmm, I've never built an Ubuntu package before, so I don't know\n>> exactly what would be required (spec file etc.) to create a PPA.\n>> But I suspect you are not talking about doing that, right?\n> \n> I would have gone for `checkinstall`... That still works, right?\n\nAh, I never think about using checkinstall - I haven't really used\nit in anger. For some reason, I thought you needed to structure your\nMakefile a certain way (using $DESTDIR or somesuch), but I seem to\nbe confusing it with something else. Apparently, no change to the\nMakefile is required - it uses some kind of filesystem watcher to\nnote which files are copied into place by 'make install'. heh, go\nfigure! :-D\n\nSo, I think you only need to set the PREFIX when building (the\ndefault installation PREFIX is $HOME), or create a local.mk file\nto configure the build (I don't do that).  The 'sparse' build\ndoes not make use of any 'auto-tools', so no configure script.\n\nAh, I think you will need to have pkg-config installed. I have\nnever built sparse from a tar-ball - I assume it works! ;-)\n\nSo (just typing into my email client - not tested):\n\n  $ wget http://www.kernel.org/pub/software/devel/sparse/dist/sparse-0.6.0.tar.gz\n  $ tar xvf sparse-0.6.0.tar.gz\n  $ cd sparse-0.6.0\n  $ make PREFIX=/usr/local\n  $ sudo checkinstall make PREFIX=/usr/local install\n\n... should do it. (famous last words).\n\nATB,\nRamsay Jones\n\n"},{"id":"367920","messageId":"20190129014426.GC7268@google.com","threadId":"50330","inReplyTo":"a6b689da-b002-0aa2-e9d6-755d004bc320@ramsayjones.plus.com","subject":"Re: sparse job, was Re: [PATCH] test-xml-encode: fix sparse NULL pointer warnings","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2019-01-29T01:44:26Z","receivedAt":"2019-01-29T01:44:32Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: Uwe Kleine-König, maintainer of the sparse package in Debian)\nHi,\n\nRamsay Jones wrote[1]:\n\n> Hmm, I've never built an Ubuntu package before, so I don't know\n> exactly what would be required (spec file etc.) to create a PPA.\n> But I suspect you are not talking about doing that, right?\n\nUbuntu uses the sparse packaging as is from Debian, so no PPA should\nbe needed.  I've sent https://bugs.debian.org/920776 to get the\npackage updated in Debian.  If all is well, it should go smoothly.\n\nThanks,\nJonathan\n\n[1] https://public-inbox.org/git/ef5a8623-e5e6-5cc8-5178-0afce7b5499e@ramsayjones.plus.com/\n"},{"id":"367921","messageId":"20190129015207.6emajopy7xqmqo4j@ltop.local","threadId":"50330","inReplyTo":"a6b689da-b002-0aa2-e9d6-755d004bc320@ramsayjones.plus.com","subject":"Re: sparse job, was Re: [PATCH] test-xml-encode: fix sparse NULL pointer warnings","fromName":"Luc Van Oostenryck","fromEmail":"luc.vanoostenryck@gmail.com","sentAt":"2019-01-29T01:52:09Z","receivedAt":"2019-01-29T01:52:13Z","isPatch":true,"sender":{"key":"luc.vanoostenryck@gmail.com","avatar":"https://avatars.githubusercontent.com/u/16168334?v=4"},"body":"On Mon, Jan 28, 2019 at 08:13:03PM +0000, Ramsay Jones wrote:\n\nHi\n\n> The dependencies for the 'sparse' package includes: libc6 (>= 2.14),\n> libllvm4.0 (>= 1:4.0~), libxml2 (>= 2.7.4), perl:any\n> \n> However, for git, we only need to build 'cgcc' and 'sparse', which\n> means we can forget about libxml (only used for c2xml), and libllvm\n> (only used for sparse-llvm/sparsec/sparsei). Also, I'm not sure what\n> perl is doing there ...\n\nperl is only used as the interpreter of cgcc.\n\n> \n> Note that these dependencies (along with the dependent programs) are\n> optional and I can happily build sparse without them:\n> \n>   $ make clean\n>   Makefile:124: Your system does not have libxml, disabling c2xml\n>   Makefile:146: Your system does not have gtk3/gtk2, disabling test-inspect\n>   Makefile:179: Your system does not have llvm, disabling sparse-llvm\n>     CLEAN\n>   $ \n\nAbsolutely.\n \n-- Luc (sparse's maintainer)\n"},{"id":"367922","messageId":"f107d853-da55-ddd2-191f-8157cd5a8edd@ramsayjones.plus.com","threadId":"50330","inReplyTo":"20190129015207.6emajopy7xqmqo4j@ltop.local","subject":"Re: sparse job, was Re: [PATCH] test-xml-encode: fix sparse NULL pointer warnings","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2019-01-29T02:23:15Z","receivedAt":"2019-01-29T02:23:21Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\n\nOn 29/01/2019 01:52, Luc Van Oostenryck wrote:\n> On Mon, Jan 28, 2019 at 08:13:03PM +0000, Ramsay Jones wrote:\n> \n> Hi\n> \n>> The dependencies for the 'sparse' package includes: libc6 (>= 2.14),\n>> libllvm4.0 (>= 1:4.0~), libxml2 (>= 2.7.4), perl:any\n>>\n>> However, for git, we only need to build 'cgcc' and 'sparse', which\n>> means we can forget about libxml (only used for c2xml), and libllvm\n>> (only used for sparse-llvm/sparsec/sparsei). Also, I'm not sure what\n>> perl is doing there ...\n> \n> perl is only used as the interpreter of cgcc.\n\nheh, yeah (palm-face), I was only thinking about _build_ dependency! :-D\n\nATB,\nRamsay Jones\n\n"}]}