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: [commit] cli/cli-script.c, script_from_file, add a break stmt for lint


Pedro Alves wrote:
On Thursday 03 March 2011 00:15:55, Michael Snyder wrote:
checked in.

2011-03-02 Michael Snyder <msnyder@vmware.com>

* cli/cli-script.c (script_from_file): Add break for lint.

        throw_error (e.error,
                     _("%s:%d: Error in sourced command file:\n%s"),
                     source_file_name, source_line_number, e.message);
+       break;  /* lint */

Please don't. Teach lint about the no-return property of throw_error instead.


       default:
        internal_error (__FILE__, __LINE__, _("bad reason"));
       }


I used "lint" loosely, to mean any checker including a human. It makes things clearer. There is plenty of precident in gdb:

language.c:  return (struct type *) 0;  /* For lint */
mt-tdep.c:          default:            /* lint */
valarith.c:  return 0;                  /* For lint -- never reached */
valops.c:  return 0;                    /* For lint -- never reached.  */
value.c:  return 0;                     /* Placate lint.  */


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