commit b39ee42904d9210ff3b6872d69535d32f588f907
parent dc199f40fb03588af0bccb149a564e895e11d60d
Author: Nick Mathewson <nickm@torproject.org>
Date: Wed, 4 Sep 2019 10:56:57 -0400
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/cc/compat_compiler.h b/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>