Browse Source

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.
Nick Mathewson 4 years ago
parent
commit
b39ee42904
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/lib/cc/compat_compiler.h

+ 1 - 1
src/lib/cc/compat_compiler.h

@@ -195,7 +195,7 @@
  * structure <b>st</b>.  Example:
  * <pre>
  *   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;
  * </pre>