Skip to content

Commit

Permalink
cgen: don't subtract null ptr in __offsetof, fix for `v -cstrict -c…
Browse files Browse the repository at this point in the history
…c clang-14 cmd/tools/vpm.v` and other programs using `import net.http` (fix #19222) (#19520)
  • Loading branch information
ttytm authored Oct 7, 2023
1 parent aba38d1 commit 1e89b0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vlib/v/gen/c/cheaders.v
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ const c_common_macros = '
// for __offset_of
#ifndef __offsetof
#define __offsetof(PTYPE,FIELDNAME) ((size_t)((char *)&((PTYPE *)0)->FIELDNAME - (char *)0))
#define __offsetof(PTYPE,FIELDNAME) ((size_t)(&((PTYPE *)0)->FIELDNAME))
#endif
#define OPTION_CAST(x) (x)
Expand Down

0 comments on commit 1e89b0b

Please sign in to comment.