This is the mail archive of the gdb-patches@sourceware.org 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: [MI non-stop 04/11] Implement --thread and --frame.


> Date: Sat, 28 Jun 2008 13:56:21 -0400
> From: "Marc Khouzam" <marc.khouzam@ericsson.com>
> 
> I'm not sure what the coding style is for GDB in this case, but I have
> found that it is more maintainable not to hard-code the lengths, but to use
> something like
>    char* threadStr = "--thread ";
>    int len = strlen(threadStr);

I'd prefer

  char threadStr[] = "--thread ";
  size_t len = sizeof(threadStr) - 1;

which will avoid any runtime penalties.


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