-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
Description
Disclaimer why this matters: (very) strict compiler settings are often required in mission critical projects.
"Regression" introduced in aeba096 adds a new strict compiler violation in gcc.
flatbuffers/flatbuffers/flatbuffer_builder.h:48:23: error: conversion from 'long unsigned int' to 'flatbuffers::voffset_t' {aka 'short unsigned int'} may change value [-Werror=conversion]
48 | return fixed_fields + field_id * sizeof(voffset_t);
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Causing code is still present in today's master branch:
// Converts a Field ID to a virtual table offset.
inline voffset_t FieldIndexToOffset(voffset_t field_id) {
// Should correspond to what EndTable() below builds up.
const voffset_t fixed_fields =
2 * sizeof(voffset_t); // Vtable size and Object Size.
return fixed_fields + field_id * sizeof(voffset_t);
}