Amrnasr / lz4

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

Please do not use #pragma once #93

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It is non-standard and while supported by gcc and clang, other C99 compilers 
might not implement it at all.

Original issue reported on code.google.com by luca.bar...@gmail.com on 16 Oct 2013 at 1:16

GoogleCodeExporter commented 8 years ago
https://github.com/lu-zero/lz4/commit/1f3d7ed16f6fb69e60d188439ffc4399609d448f

Original comment by luca.bar...@gmail.com on 16 Oct 2013 at 2:29

GoogleCodeExporter commented 8 years ago
It's also supported by Visual & TCC.
Do you have an example of compiler which does not support #pragma once ?

Original comment by yann.col...@gmail.com on 16 Oct 2013 at 8:59

GoogleCodeExporter commented 8 years ago
sparse till got forced to add it recently I notice, pcc should not,
cparser should not.

#pragma once has the not so nice defect to mix badly with include_next
(other extension quite common) or anything that relies on the included
file path varying.
Hopefully nobody will be bitten and nobody will bundle lz4 and have a
nice collision because an lz4.h is present in the system headers
(#pragma once can happily consider the two different), but that is
people doing it wrong from start (bundling is bad).

Original comment by luca.bar...@gmail.com on 16 Oct 2013 at 10:08

GoogleCodeExporter commented 8 years ago

Original comment by yann.col...@gmail.com on 7 Jan 2014 at 6:53