{"thread":{"id":"7483","subject":"[PATCH] Rename warn() to warning() to fix symbol conflicts on BSD and Mac OS","startedAt":"2007-03-30T23:07:05Z","lastAt":"2007-04-01T10:25:54Z","messageCount":5,"participants":["Theodore Ts'o","Junio C Hamano","Johannes Schindelin","Randal L. Schwartz","Alex Riesen"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"38386","messageId":"11752960251394-git-send-email-tytso@mit.edu","threadId":"7483","inReplyTo":null,"subject":"[PATCH] Rename warn() to warning() to fix symbol conflicts on BSD and Mac OS","fromName":"Theodore Ts'o","fromEmail":"tytso@mit.edu","sentAt":"2007-03-30T23:07:05Z","receivedAt":"2007-03-30T23:07:05Z","isPatch":true,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"This fixes a problem reported by Randal Schwartz:\n\n>I finally tracked down all the (albeit inconsequential) errors I was getting\n>on both OpenBSD and OSX.  It's the warn() function in usage.c.  There's\n>warn(3) in BSD-style distros.  It'd take a \"great rename\" to change it, but if\n>someone with better C skills than I have could do that, my linker and I would\n>appreciate it.\n\nIt was annoying to me, too, when I was doing some mergetool testing on\nMac OS X, so here's a fix.\n\nSigned-off-by: \"Theodore Ts'o\" <tytso@mit.edu>\nCc: \"Randal L. Schwartz\" <merlyn@stonehenge.com>\n---\n builtin-bundle.c  |    4 ++--\n fast-import.c     |    2 +-\n git-compat-util.h |    2 +-\n revision.c        |    2 +-\n usage.c           |    2 +-\n 5 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/builtin-bundle.c b/builtin-bundle.c\nindex 0a9b738..d1635a0 100644\n--- a/builtin-bundle.c\n+++ b/builtin-bundle.c\n@@ -87,7 +87,7 @@ static int read_header(const char *path, struct bundle_header *header) {\n \t\tif (buffer[len - 1] == '\\n')\n \t\t\tbuffer[len - 1] = '\\0';\n \t\tif (get_sha1_hex(buffer + offset, sha1)) {\n-\t\t\twarn(\"unrecognized header: %s\", buffer);\n+\t\t\twarning(\"unrecognized header: %s\", buffer);\n \t\t\tcontinue;\n \t\t}\n \t\tdelim = buffer[40 + offset];\n@@ -268,7 +268,7 @@ static int create_bundle(struct bundle_header *header, const char *path,\n \t\t * from getting output.\n \t\t */\n \t\tif (!(e->item->flags & SHOWN)) {\n-\t\t\twarn(\"ref '%s' is excluded by the rev-list options\",\n+\t\t\twarning(\"ref '%s' is excluded by the rev-list options\",\n \t\t\t\te->name);\n \t\t\tcontinue;\n \t\t}\ndiff --git a/fast-import.c b/fast-import.c\nindex bea1215..cdd629d 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -1312,7 +1312,7 @@ static int update_branch(struct branch *b)\n \n \t\tif (!in_merge_bases(old_cmit, &new_cmit, 1)) {\n \t\t\tunlock_ref(lock);\n-\t\t\twarn(\"Not updating %s\"\n+\t\t\twarning(\"Not updating %s\"\n \t\t\t\t\" (new tip %s does not contain %s)\",\n \t\t\t\tb->name, sha1_to_hex(b->sha1), sha1_to_hex(old_sha1));\n \t\t\treturn -1;\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 7534db1..139fc19 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -87,7 +87,7 @@\n extern void usage(const char *err) NORETURN;\n extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));\n extern int error(const char *err, ...) __attribute__((format (printf, 1, 2)));\n-extern void warn(const char *err, ...) __attribute__((format (printf, 1, 2)));\n+extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));\n \n extern void set_usage_routine(void (*routine)(const char *err) NORETURN);\n extern void set_die_routine(void (*routine)(const char *err, va_list params) NORETURN);\ndiff --git a/revision.c b/revision.c\nindex f23c1d5..486393c 100644\n--- a/revision.c\n+++ b/revision.c\n@@ -486,7 +486,7 @@ static void handle_one_reflog_commit(unsigned char *sha1, void *cb_data)\n \t\t\tadd_pending_object(cb->all_revs, o, \"\");\n \t\t}\n \t\telse if (!cb->warned_bad_reflog) {\n-\t\t\twarn(\"reflog of '%s' references pruned commits\",\n+\t\t\twarning(\"reflog of '%s' references pruned commits\",\n \t\t\t\tcb->name_for_errormsg);\n \t\t\tcb->warned_bad_reflog = 1;\n \t\t}\ndiff --git a/usage.c b/usage.c\nindex 4dc5c77..f5e652c 100644\n--- a/usage.c\n+++ b/usage.c\n@@ -86,7 +86,7 @@ int error(const char *err, ...)\n \treturn -1;\n }\n \n-void warn(const char *warn, ...)\n+void warning(const char *warn, ...)\n {\n \tva_list params;\n \n-- \n1.5.1.rc3.20.gaa453\n"},{"id":"38418","messageId":"7vejn5ygkc.fsf@assigned-by-dhcp.cox.net","threadId":"7483","inReplyTo":"11752960251394-git-send-email-tytso@mit.edu","subject":"Re: [PATCH] Rename warn() to warning() to fix symbol conflicts on BSD and Mac OS","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-31T08:15:31Z","receivedAt":"2007-03-31T08:15:31Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Theodore Ts'o <tytso@mit.edu> writes:\n\n> This fixes a problem reported by Randal Schwartz:\n>\n>>I finally tracked down all the (albeit inconsequential) errors I was getting\n>>on both OpenBSD and OSX.  It's the warn() function in usage.c.  There's\n>>warn(3) in BSD-style distros.  It'd take a \"great rename\" to change it, but if\n>>someone with better C skills than I have could do that, my linker and I would\n>>appreciate it.\n>\n> It was annoying to me, too, when I was doing some mergetool testing on\n> Mac OS X, so here's a fix.\n\nI'd take this for now, but I wonder where we should stop.  If\nsomebody exports error() or die(), would we end up renaming them\nto git_error() and git_die()?\n"},{"id":"38422","messageId":"Pine.LNX.4.63.0703311245510.4045@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"7483","inReplyTo":"7vejn5ygkc.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Rename warn() to warning() to fix symbol conflicts on BSD and Mac OS","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-03-31T10:46:05Z","receivedAt":"2007-03-31T10:46:05Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 31 Mar 2007, Junio C Hamano wrote:\n\n> Theodore Ts'o <tytso@mit.edu> writes:\n> \n> > This fixes a problem reported by Randal Schwartz:\n> >\n> >>I finally tracked down all the (albeit inconsequential) errors I was getting\n> >>on both OpenBSD and OSX.  It's the warn() function in usage.c.  There's\n> >>warn(3) in BSD-style distros.  It'd take a \"great rename\" to change it, but if\n> >>someone with better C skills than I have could do that, my linker and I would\n> >>appreciate it.\n> >\n> > It was annoying to me, too, when I was doing some mergetool testing on\n> > Mac OS X, so here's a fix.\n> \n> I'd take this for now, but I wonder where we should stop.  If\n> somebody exports error() or die(), would we end up renaming them\n> to git_error() and git_die()?\n\nLibification, here we come ;-)\n\nCiao,\nDscho\n"},{"id":"38437","messageId":"863b3lfozg.fsf@blue.stonehenge.com","threadId":"7483","inReplyTo":"7vejn5ygkc.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Rename warn() to warning() to fix symbol conflicts on BSD and Mac OS","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2007-03-31T14:48:35Z","receivedAt":"2007-03-31T14:48:35Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Junio\" == Junio C Hamano <junkio@cox.net> writes:\n\nJunio> I'd take this for now, but I wonder where we should stop.  If\nJunio> somebody exports error() or die(), would we end up renaming them\nJunio> to git_error() and git_die()?\n\nI realize you may see it as a slippery slope, but I haven't heard anything\nelse reported yet, and git has already been ported quite a bit.  But since C\nhas a flat namespace, this will always be a problem.\n\nPicking a name like warn(3) was probably dumb on bsd's part, but it *is* a\ngeneric call like perror(3).\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"38466","messageId":"20070401102554.GA20579@steel.home","threadId":"7483","inReplyTo":"7vejn5ygkc.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Rename warn() to warning() to fix symbol conflicts on BSD and Mac OS","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2007-04-01T10:25:54Z","receivedAt":"2007-04-01T10:25:54Z","isPatch":true,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"Junio C Hamano, Sat, Mar 31, 2007 10:15:31 +0200:\n> >>I finally tracked down all the (albeit inconsequential) errors I was getting\n> >>on both OpenBSD and OSX.  It's the warn() function in usage.c.  There's\n> >>warn(3) in BSD-style distros.  It'd take a \"great rename\" to change it, but if\n> >>someone with better C skills than I have could do that, my linker and I would\n> >>appreciate it.\n> >\n> > It was annoying to me, too, when I was doing some mergetool testing on\n> > Mac OS X, so here's a fix.\n> \n> I'd take this for now, but I wonder where we should stop. \n\nGlibc also has warn(3) - see err.h for example.\n(why is it part of libc, I wonder...)\n"}]}