{"thread":{"id":"3630","subject":"[PATCH] imap-send: cleanup execl() call to use NULL sentinel instead of 0","startedAt":"2006-03-11T08:55:50Z","lastAt":"2006-03-11T20:30:22Z","messageCount":3,"participants":["Marco Roeland","Morten Welinder"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"17456","messageId":"20060311085550.GA32089@fiberbit.xs4all.nl","threadId":"3630","inReplyTo":null,"subject":"[PATCH] imap-send: cleanup execl() call to use NULL sentinel instead of 0","fromName":"Marco Roeland","fromEmail":"marco.roeland@xs4all.nl","sentAt":"2006-03-11T08:55:50Z","receivedAt":"2006-03-11T08:55:50Z","isPatch":true,"sender":{"key":"marco.roeland@xs4all.nl","avatar":null},"body":"Some versions of gcc check that calls to the exec() family have the proper\nsentinel for variadic calls. This should be (char *) NULL according to the\nman page. Although for all other purposes the 0 is equivalent, gcc\nnevertheless does emit a warning for 0 and not for NULL. This also makes the\nusage consistent throughout git.\n\nThe whitespace in function calls throughout imap-send.c has its own style,\nso I left it that way.\n\n---\n\n imap-send.c |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndb1a0875cbc28970208e7a2fbb93d680d8ffe572\ndiff --git a/imap-send.c b/imap-send.c\nindex fddaac0..203284d 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -945,7 +945,7 @@ imap_open_store( imap_server_conf_t *srv\n \t\t\t\t_exit( 127 );\n \t\t\tclose( a[0] );\n \t\t\tclose( a[1] );\n-\t\t\texecl( \"/bin/sh\", \"sh\", \"-c\", srvc->tunnel, 0 );\n+\t\t\texecl( \"/bin/sh\", \"sh\", \"-c\", srvc->tunnel, NULL );\n \t\t\t_exit( 127 );\n \t\t}\n \n-- \n1.2.4.ge29f\nMarco Roeland\n"},{"id":"17459","messageId":"118833cc0603110601x6ac9b2b6kaa0277981c6dd44b@mail.gmail.com","threadId":"3630","inReplyTo":"20060311085550.GA32089@fiberbit.xs4all.nl","subject":"Re: [PATCH] imap-send: cleanup execl() call to use NULL sentinel instead of 0","fromName":"Morten Welinder","fromEmail":"mwelinder@gmail.com","sentAt":"2006-03-11T14:01:49Z","receivedAt":"2006-03-11T14:01:49Z","isPatch":true,"sender":{"key":"mwelinder@gmail.com","avatar":null},"body":"If you're going to fix that, you should use (char *)NULL or\n(char *)0, just in case you end up on a machine where\nNULL doesn't a pointer type.\n\n(Yup, NULL can be a null pointer without having pointer type.)\n\nM.\n"},{"id":"17462","messageId":"20060311203022.GA1578@fiberbit.xs4all.nl","threadId":"3630","inReplyTo":"118833cc0603110601x6ac9b2b6kaa0277981c6dd44b@mail.gmail.com","subject":"Re: [PATCH] imap-send: cleanup execl() call to use NULL sentinel instead of 0","fromName":"Marco Roeland","fromEmail":"marco.roeland@xs4all.nl","sentAt":"2006-03-11T20:30:22Z","receivedAt":"2006-03-11T20:30:22Z","isPatch":true,"sender":{"key":"marco.roeland@xs4all.nl","avatar":null},"body":"On Saturday March 11th 2006 Morten Welinder wrote:\n\n> If you're going to fix that, you should use (char *)NULL or\n> (char *)0, just in case you end up on a machine where\n> NULL doesn't a pointer type.\n> \n> (Yup, NULL can be a null pointer without having pointer type.)\n\nFor gcc NULL is specifically always guaranteed to be a valid sentinel.\nAnd it was basically just about fixing the gcc warning, no pedantics\nintended! All other uses within git for the exec() family also use plain\nuncast NULL, which looks better anyway.\n\nStrictly speaking you're probably right, but there's a chance that this\nwill generate warnings on other compilers.\n\nAnd if you should use a compiler with a weird notion of NULL, you're\nprobably better off switching compilers immediately. ;-)\n-- \nMarco Roeland\n"}]}