[ofw] Re: [ofa-general] Issues with _osm_lin_fwd_tbl

Tzachi Dar tzachid at mellanox.co.il
Thu Jun 12 05:46:05 PDT 2008


The surrounded can be bigger than the actual array (for example a whole
file).

Thanks
Tzachi

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Hal Rosenstock
> Sent: Thursday, June 12, 2008 2:43 PM
> To: Leonid Keller
> Cc: ofw at lists.openfabrics.org; Sasha Khapyorsky; Vincent 
> Ficet; general at lists.openfabrics.org
> Subject: RE: [ofw] Re: [ofa-general] Issues with _osm_lin_fwd_tbl
> 
> On Thu, 2008-06-12 at 13:50 +0300, Leonid Keller wrote:
> > One can use zero-sized arrays as a structure member, having 
> disabled 
> > the warning 4200.
> > Here is a real example from hw\mlx4\kernel\bus\core\cache.c:
> > 
> > 	#pragma warning( disable : 4200)
> > 	struct ib_pkey_cache {
> > 		int             table_len;
> > 		__be16          table[0];
> > 	};
> > 	#pragma warning( default  : 4200)
> 
> So to use this with Windows, any zero size array needs to be 
> surrounded by the pragma pair ?
> 
> -- Hal
> 
> > > -----Original Message-----
> > > From: ofw-bounces at lists.openfabrics.org 
> > > [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Hal 
> > > Rosenstock
> > > Sent: Thursday, June 12, 2008 1:17 PM
> > > To: Sasha Khapyorsky
> > > Cc: ofw at lists.openfabrics.org; Vincent Ficet; 
> > > general at lists.openfabrics.org
> > > Subject: [ofw] Re: [ofa-general] Issues with _osm_lin_fwd_tbl
> > > 
> > > On Thu, 2008-06-12 at 13:00 +0300, Sasha Khapyorsky wrote:
> > > > On 16:51 Wed 11 Jun     , Vincent Ficet wrote:
> > > > >
> > > > > Also, could anyone explain why the osm_lin_fwd_tbl_t is
> > > declared as
> > > > > follows:
> > > > >
> > > > > typedef struct _osm_lin_fwd_tbl {
> > > > >    uint16_t size;
> > > > >    uint8_t port_tbl[1];
> > > > > } osm_lin_fwd_tbl_t;
> > > > 
> > > > AFAIR the reason is a poor windows compiler which 
> doesn't support 
> > > > array[0] like definitions in structures.
> > > 
> > > Yes, I too recall something being said along those lines quite a 
> > > while ago.
> > > 
> > > Is this accurate ? If so, is this still a restriction of 
> the Windows 
> > > compilers in use (as I think the build environment and 
> perhaps the 
> > > compilers have changed quite a bit since
> > > then) ? Can someone knowledgeable in Windows comment on this ?
> > > 
> > > -- Hal
> > > 
> > > > Sasha
> > > > _______________________________________________
> > > > general mailing list
> > > > general at lists.openfabrics.org
> > > > http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general
> > > > 
> > > > To unsubscribe, please visit
> > > > http://openib.org/mailman/listinfo/openib-general
> > > 
> > > _______________________________________________
> > > ofw mailing list
> > > ofw at lists.openfabrics.org
> > > http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
> > > 
> 
> _______________________________________________
> ofw mailing list
> ofw at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
> 


--
Tzachi Dar
Mellanox Technologies LTD.
SW- Windows
Phone: +972 (4) 909 7200 (ext 271)
Mobile: +972 (57) 741 1269
E-mail: tzachid at mellanox.co.il

----------------------------------------------------------------------
Emails belong on computers, trees belong in forests; if you must print
this, do it on recycled paper.
http://www.greenpeace.org/international/
----------------------------------------------------------------------


Disclaimer added by CodeTwo Exchange Rules
http://www.codetwo.com



More information about the general mailing list