This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: filtering of commands during async operation


>>>>> "Grant" == Grant Edwards <grante@visi.com> writes:

 >> Good example of why it's useful to avoid using ! with strcmp.

 Grant> Why not just strcmp() ?

 Grant> if (strcmp() && strcmp() && strcmp())

Because strcmp isn't a boolean function.  Using boolean operations on
non-boolean values is a great way to produce bugs (as the example
showed).  It has a precise meaning in C, but that doesn't mean it
should be done.

       paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]