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]

[commit] Fix the source.c gcc4 warning


As Mark also noticed, changing lines_to_list to an unsigned integer is the
wrong fix for this problem.  This is the right one.  It has to remain
signed, because we use max (sal.line - lines_to_list, 1); if the left
promotes to unsigned, then the result will be a large number on overflow
instead of 1.

This doesn't substantively change the result of typing "set listsize -1",
which shouldn't really be allowed either before or after.  Someone else can
get inspired and fix that one.

One down, 188 to go.  Tested on x86_64-pc-linux-gnu.

-- 
Daniel Jacobowitz
CodeSourcery

2006-01-15  Daniel Jacobowitz  <dan@codesourcery.com>

	* source.c (_initialize_source): Use add_setshow_integer_cmd.

Index: source.c
===================================================================
RCS file: /cvs/src/src/gdb/source.c,v
retrieving revision 1.71
diff -u -p -r1.71 source.c
--- source.c	17 Dec 2005 22:34:02 -0000	1.71
+++ source.c	15 Jan 2006 19:08:40 -0000
@@ -1638,7 +1638,7 @@ The matching line number is also stored 
       add_com_alias ("?", "reverse-search", class_files, 0);
     }
 
-  add_setshow_uinteger_cmd ("listsize", class_support, &lines_to_list, _("\
+  add_setshow_integer_cmd ("listsize", class_support, &lines_to_list, _("\
 Set number of source lines gdb will list by default."), _("\
 Show number of source lines gdb will list by default."), NULL,
 			    NULL,


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