[brlcad-tracker] [Google Code-in 2012] New comment on Fix Mac OS X compilation errors under Buildbo
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <no-...@go...> - 2012-12-29 06:49:25
|
Hi, Sean has left the following comment at Fix Mac OS X compilation errors under Buildbot http://www.google-melange.com/gci/task/view/google/gci2012/8081208: I was going to say I was just about to say... that wasn't my understanding of what that warning means. It's not warning on any use of offsetof(). It's uses that call an extended field. Something like this should work: #include <stddef.h> #include <stdio.h> struct foo { char meh; int bar; }; int main (int ac, char *av[]) { if (ac) { printf("%s: offset is %zu\n", av[0], offsetof(struct foo, bar)); } return 0; } Assuming that is the case and the issue is not passing struct elements, then we can look into what follow-on work is involved and this task can be to just scope the extent of the problem. The fix for the example you gave is probably just pulling the array index outside of the offset call ala bu_offsetof(struct t, arr) + (sizeof(arr[0])*1)+(sizeof(arr[0][0])*1) ... and maybe even doing all that mess behind a macro. Greetings, The Google Open Source Programs Team --- You are receiving this message because you are subscribed to Fix Mac OS X compilation errors under Buildbot. To stop receiving these messages, go to: http://www.google-melange.com/gci/task/view/google/gci2012/8081208. |