Dmitry V. Levin on 29 Mar 2006 21:01:44 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [tcptra-dev] tcptraceroute-1.5beta7


On Wed, Mar 29, 2006 at 03:54:05PM -0500, Michael C. Toren wrote:
> On Thu, Mar 30, 2006 at 12:26:36AM +0400, Dmitry V. Levin wrote:
> > I have few patches made long time ago for beta5 and later rediffed for
> > beta6.  The most obvious one is attached.
> 
> Hi Dmitry,
> 
> >  	if (device == NULL)
> > -		fatal("Could not determine device via pcap_lookupdev(): %\n", errbuf);
> > +		fatal("Could not determine device via pcap_lookupdev(): %s\n", errbuf);
> 
> Oops.  Thanks, I've incorporated the change.
> 
> Regarding the other changes you posted, which are specific to gcc:
> 
> > -void fatal(char *, ...);
> > +void fatal(char *, ...) TCPTRACEROUTE_NORETURN TCPTRACEROUTE_FORMAT((__printf__, 1, 2));
> 
> I'm not sure I see the additional benefit compared the complexity it
> introduces?

When gcc >= 2.5 is available, it helps to avoid format string errors in
custom format functions (like typo cited above).
Without this compiler, this change is noop.
This approach is known to work in many projects, and tcptraceroute may
benefit from it too.
You can shorten TCPTRACEROUTE_ prefix to make the code more readable.


-- 
ldv

Attachment: pgpfDih498eRg.pgp
Description: PGP signature

_______________________________________________
tcptraceroute-dev mailing list
tcptraceroute-dev@netisland.net
http://lists.netisland.net/mailman/listinfo/tcptraceroute-dev