caisan / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
0 stars 0 forks source link

warning fix: UTP stream #617

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
2>..\src\utp_stream.cpp(173): warning C4200: nonstandard extension used : 
zero-sized array in struct/union
2>          Cannot generate copy-ctor or copy-assignment operator when UDT 
contains a zero-sized arra

i think converting [] to * might fix the warning, but i am not sure if that 
changes the behavior of any sizeof's in the code:
http://upload.beamng.com/patches/utp_stream.patch

Original issue reported on code.google.com by tho...@thomasfischer.biz on 9 May 2014 at 7:16

GoogleCodeExporter commented 8 years ago
changing it to a pointer also changes semantics. the zero-sized array is used 
to access bytes immediately following the struct. The standard way to fix it 
would be to create a 1 byte array. However, that might require changing the 
points of allocation also.

but this patch would definitely break utp.

Original comment by arvid.no...@gmail.com on 10 May 2014 at 3:28