From: Nick Mathewson Date: Wed, 4 Sep 2019 14:56:57 +0000 (-0400) Subject: compat_compiler: fix documentation for STRUCT_VAR_P X-Git-Tag: tor-0.4.2.1-alpha~35^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b39ee42904d9210ff3b6872d69535d32f588f907;p=thirdparty%2Ftor.git compat_compiler: fix documentation for STRUCT_VAR_P Previously we had said that off_t was a reasonable type to hold the result of offsetof(). That isn't so: ptrdiff_t is correct. --- diff --git a/src/lib/cc/compat_compiler.h b/src/lib/cc/compat_compiler.h index a8d1593214..92301449e8 100644 --- a/src/lib/cc/compat_compiler.h +++ b/src/lib/cc/compat_compiler.h @@ -195,7 +195,7 @@ * structure st. Example: *
  *   struct a { int foo; int bar; } x;
- *   off_t bar_offset = offsetof(struct a, bar);
+ *   ptrdiff_t bar_offset = offsetof(struct a, bar);
  *   int *bar_p = STRUCT_VAR_P(&x, bar_offset);
  *   *bar_p = 3;
  *