[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87obbsohd1.fsf@nemi.mork.no>
Date: Thu, 30 May 2013 13:08:10 +0200
From: Bjørn Mork <bjorn@...k.no>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc: Davidlohr Bueso <davidlohr.bueso@...com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, netdev@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: skbuff: use _RET_IP_
Sergei Shtylyov <sergei.shtylyov@...entembedded.com> writes:
> Why not "text:%#lx" as already used in this string? It's
> equivalent to "0x%lx".
Well, I don't know the reasoning in this case, but I'd like to note that
those are not strictly equivalent. Personally I find the formatting of 0
annoying enough to avoid %#x for any value which may be 0. It's
especially bad if you try to line up things by adding leading zeros.
I would expect these to produce the same result, but they don't:
printf("0x%02hhx\n", 0);
printf("%#04hhx\n", 0);
Ending up with a 4 digit output when you expect 2 is very confusing. It
doesn't matter that 0 is 0 in any case. Why doesn't the same happen to
1 then? This is just inconsistent behaviour, and I see no valid excuse
for it.
IMHO the single format character saved isn't worth this at all. I'll
continue using 0x%x
Bjørn
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists