[openib-general] Re: Opensm - osm_sa_path_record.c - variable declaration

2005-09-20 Thread Hal Rosenstock
Hi Yael,

On Tue, 2005-09-20 at 04:58, Yael Kalka wrote:
 I saw that in your code fixes of osm_sa_path_record.c you added some
 variable declaration
 in the middle of function (osm_pr_rcv_process - in the McastDest
 case).
 Windows compiler does not enable declaration not in the beginning of
 the function, so I would
 like to have it changed. 
 We can either move the declaration to the beginning of the function,
 or add {} around the declaration.

Please note that I don't have a Windows environment for OpenSM
development.

 Do you have a preference?

Ny preference would be the latter.

-- Hal

 Yael
 
 
 -Original Message-
 From: Yael Kalka 
 Sent: Tuesday, September 20, 2005 10:48 AM
 To: [EMAIL PROTECTED]
 Cc: openib-general@openib.org; Eitan Zahavi; Yael Kalka
 Subject: [PATCH] Opensm - ignore strict-aliasing warning
 
 
 Hi Hal,
 
 Attached is a patch forcing the compiler not to do strict-aliasing
 optimization on the opensm code, due to strict-aliasing warnings in
 our code.
 
 Thanks,
 Yael
 
 Signed-off-by:  Yael Kalka [EMAIL PROTECTED]
 
 Index: opensm/Makefile.am
 ===
 --- opensm/Makefile.am  (revision 3487)
 +++ opensm/Makefile.am  (working copy)
 @@ -64,7 +64,7 @@ opensm_SOURCES = main.c osm_db_files.c o
  osm_ucast_mgr.c osm_ucast_updn.c \
  osm_vl15intf.c osm_vl_arb_rcv.c\
  osm_vl_arb_rcv_ctrl.c st.c
 -opensm_CFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT
 $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
 +opensm_CFLAGS = -Wall $(OSMV_CFLAGS) -fno-strict-aliasing
 -DVENDOR_RMPP_SUPPORT $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
 
  opensm_CXXFLAGS = -Wall $(OSMV_CFLAGS) -DVENDOR_RMPP_SUPPORT
 $(DBGFLAGS) -D_XOPEN_SOURCE=600 -D_BSD_SOURCE=1
  
  # for linking with the simulator client library we have to use g++:
 

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general


Re: [openib-general] Re: Opensm - osm_sa_path_record.c - variable declaration

2005-09-20 Thread Greg Lindahl
 Windows compiler does not enable declaration not in the beginning of
 the function, so I would
 like to have it changed. 
 We can either move the declaration to the beginning of the function,
 or add {} around the declaration.

Isn't there a gcc flag to convince it to give an error in this case? If
so, adding it to the OpenIB makefile would be a good idea.

-- greg

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general


Re: [openib-general] Re: Opensm - osm_sa_path_record.c - variable declaration

2005-09-20 Thread Roland Dreier
Greg Isn't there a gcc flag to convince it to give an error in
Greg this case? If so, adding it to the OpenIB makefile would be
Greg a good idea.

gcc 3.4 added -Wdeclaration-after-statement.  However, older gcc
versions don't accept the option.  In fact gcc 2.95 doesn't accept
declarations after statements.

In any case it takes at least a little autoconf magic to add the flag
only if the compiler being used accepts it.

 - R.
___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general