Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [PATCH]: misc header file cleanup.
@ 2001-03-01 12:59 Michael Elizabeth Chastain
  2001-03-01 13:43 ` J.T. Conklin
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2001-03-01 12:59 UTC (permalink / raw)
  To: jtc; +Cc: gdb-patches

Proofread, no problems found.

MIN_OF_TYPE is never used.  MAX_OF_TYPE is used only in m2-exp.y in some
code that is #if 0'd out.

Michael


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]: misc header file cleanup.
  2001-03-01 12:59 [PATCH]: misc header file cleanup Michael Elizabeth Chastain
@ 2001-03-01 13:43 ` J.T. Conklin
  0 siblings, 0 replies; 5+ messages in thread
From: J.T. Conklin @ 2001-03-01 13:43 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gdb-patches

>>>>> "Michael" == Michael Elizabeth Chastain <chastain@cygnus.com> writes:
Michael> Proofread, no problems found.

Many thanks.

Michael> MIN_OF_TYPE is never used.  MAX_OF_TYPE is used only in
Michael> m2-exp.y in some code that is #if 0'd out.

Correct.  But had that code in m2-exp.y been enabled, the lack of
parens in MAX_OF_TYPE would have surprising results.  In any case,
there is no harm to fix the macros now in case someone decides to
use them later.

I suspect there will be quite a few nits that linting will be turn up.
Some will be of this nature, where it's a "obviously correct" fix.  I
suspect quite a few will highlight poor divisions of interface and
implementation (for example, declarations of functions in multiple
header files, etc.).  And other things I choose to simple suppress
(fortunately, the lint I'm using has very finegrained control over
error message generation).

        --jtc

-- 
J.T. Conklin
RedBack Networks


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]: misc header file cleanup.
  2001-03-01 14:12 Michael Elizabeth Chastain
@ 2001-03-01 14:57 ` J.T. Conklin
  0 siblings, 0 replies; 5+ messages in thread
From: J.T. Conklin @ 2001-03-01 14:57 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: gdb-patches

>>>>> "Michael" == Michael Elizabeth Chastain <chastain@cygnus.com> writes:
>> And other things I choose to simple suppress (fortunately, the lint
>> I'm using has very finegrained control over error message
>> generation).

Michael> I'm interested in operator precedence errors.  I have noticed
Michael> "a % b * c" (where the author meant "a % (b * c)") and also
Michael> the classic "a & b == c".

The program I'm using can detect the latter (Warning 514: Unusual use
of a Boolean), but not the former.  Rest assured, I'll be sharing all
interesting results.

        --jtc

-- 
J.T. Conklin
RedBack Networks


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH]: misc header file cleanup.
@ 2001-03-01 14:12 Michael Elizabeth Chastain
  2001-03-01 14:57 ` J.T. Conklin
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Elizabeth Chastain @ 2001-03-01 14:12 UTC (permalink / raw)
  To: jtc; +Cc: gdb-patches

Hi J. T.,

> In any case, there is no harm to fix the macros now in case someone
> decides to use them later.

Agreed.

> And other things I choose to simple suppress (fortunately, the lint I'm
> using has very finegrained control over error message generation).

I'm interested in operator precedence errors.  I have noticed "a % b * c"
(where the author meant "a % (b * c)") and also the classic
"a & b == c".

Michael


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH]: misc header file cleanup.
@ 2001-03-01 12:53 J.T. Conklin
  0 siblings, 0 replies; 5+ messages in thread
From: J.T. Conklin @ 2001-03-01 12:53 UTC (permalink / raw)
  To: gdb-patches

I'll be committing the following change soon.  Just some cruft I found
while setting things up so I can lint GDB.

        --jtc

2001-03-01  J.T. Conklin  <jtc@redback.com>

	* gdbtypes.h (builtin_type_f_integer): Removed duplicate declaration.
	(MAX_OF_TYPE): Wrap macro definition in parenthesis.
	(MIN_OF_TYPE): Likewise.
	
	* memattr.h (mem_access_mode): Removed extraneous trailing comma.

Index: gdbtypes.h
===================================================================
RCS file: /cvs/src/src/gdb/gdbtypes.h,v
retrieving revision 1.6
diff -c -r1.6 gdbtypes.h
*** gdbtypes.h	2000/09/02 00:05:43	1.6
--- gdbtypes.h	2001/03/01 19:53:14
***************
*** 905,915 ****
  
  extern struct type *builtin_type_f_character;
  extern struct type *builtin_type_f_integer;
  extern struct type *builtin_type_f_logical;
  extern struct type *builtin_type_f_logical_s1;
  extern struct type *builtin_type_f_logical_s2;
- extern struct type *builtin_type_f_integer;
- extern struct type *builtin_type_f_integer_s2;
  extern struct type *builtin_type_f_real;
  extern struct type *builtin_type_f_real_s8;
  extern struct type *builtin_type_f_real_s16;
--- 905,914 ----
  
  extern struct type *builtin_type_f_character;
  extern struct type *builtin_type_f_integer;
+ extern struct type *builtin_type_f_integer_s2;
  extern struct type *builtin_type_f_logical;
  extern struct type *builtin_type_f_logical_s1;
  extern struct type *builtin_type_f_logical_s2;
  extern struct type *builtin_type_f_real;
  extern struct type *builtin_type_f_real_s8;
  extern struct type *builtin_type_f_real_s16;
***************
*** 924,935 ****
  /* Maximum and minimum values of built-in types */
  
  #define	MAX_OF_TYPE(t)	\
!    TYPE_UNSIGNED(t) ? UMAX_OF_SIZE(TYPE_LENGTH(t)) \
!     : MAX_OF_SIZE(TYPE_LENGTH(t))
  
  #define MIN_OF_TYPE(t)	\
!    TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) \
!     : MIN_OF_SIZE(TYPE_LENGTH(t))
  
  /* Allocate space for storing data associated with a particular type.
     We ensure that the space is allocated using the same mechanism that
--- 923,934 ----
  /* Maximum and minimum values of built-in types */
  
  #define	MAX_OF_TYPE(t)	\
!    (TYPE_UNSIGNED(t) ? UMAX_OF_SIZE(TYPE_LENGTH(t)) \
!     : MAX_OF_SIZE(TYPE_LENGTH(t)))
  
  #define MIN_OF_TYPE(t)	\
!    (TYPE_UNSIGNED(t) ? UMIN_OF_SIZE(TYPE_LENGTH(t)) \
!     : MIN_OF_SIZE(TYPE_LENGTH(t)))
  
  /* Allocate space for storing data associated with a particular type.
     We ensure that the space is allocated using the same mechanism that
Index: memattr.h
===================================================================
RCS file: /cvs/src/src/gdb/memattr.h,v
retrieving revision 1.1
diff -c -r1.1 memattr.h
*** memattr.h	2001/01/23 22:48:55	1.1
--- memattr.h	2001/03/01 19:53:15
***************
*** 6,12 ****
  {
    MEM_RW,			/* read/write */
    MEM_RO,			/* read only */
!   MEM_WO,			/* write only */
  };
  
  enum mem_access_width
--- 6,12 ----
  {
    MEM_RW,			/* read/write */
    MEM_RO,			/* read only */
!   MEM_WO			/* write only */
  };
  
  enum mem_access_width


-- 
J.T. Conklin
RedBack Networks


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-03-01 14:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-01 12:59 [PATCH]: misc header file cleanup Michael Elizabeth Chastain
2001-03-01 13:43 ` J.T. Conklin
  -- strict thread matches above, loose matches on Subject: below --
2001-03-01 14:12 Michael Elizabeth Chastain
2001-03-01 14:57 ` J.T. Conklin
2001-03-01 12:53 J.T. Conklin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox