Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why c++ generated header in sample skip field id 12? #47

Closed
jacobwpeng opened this issue Aug 14, 2014 · 2 comments
Closed

Why c++ generated header in sample skip field id 12? #47

jacobwpeng opened this issue Aug 14, 2014 · 2 comments

Comments

@jacobwpeng
Copy link

New to this amazing lib, I'm very curious about the generated header of monster.fbs
add_name calls AddOffset(10, name);
add_inventory calls AddOffset(14, inventory);

I manually changed 14 to 12, and next color field from 16 to 12, everything works jsut fine!
and from the source code I read, AddOffset just PushElement of length sizeof(voffset_t), so there shouldn't be any problem with that.
And I print all the voffset_t in vtable offsets, field 12 is 0.
Forgive me if I missing something really obviously...

@ghost
Copy link

ghost commented Aug 14, 2014

If you look in the schema file, you'll see that the field at offset 12 in the vtable is a deprecated field. It is present in the vtable, but not in the object. If you go change these offsets, you'll break forwards/backwards compatability (see the "internals" document).

@ghost ghost closed this as completed Aug 14, 2014
@jacobwpeng
Copy link
Author

Thanks, I do forget that deprecated field...

kakikubo pushed a commit to kakikubo/flatbuffers that referenced this issue Apr 19, 2016
write master_data_generated.h.md5 and user_data.h.md5
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant