diff options
| author | Julian Andres Klode <jak@debian.org> | 2025-06-10 17:23:41 +0200 |
|---|---|---|
| committer | Julian Andres Klode <jak@debian.org> | 2025-06-10 17:29:33 +0200 |
| commit | ed836aa73a87b9d60e81c607d5b4f57e9b82f948 (patch) | |
| tree | 0efad303b1247f06d1184d644c248ae93fb039e1 /apt-pkg/pkgcachegen.cc | |
| parent | 9e6772f6bb13c2606a86e4046a9c4ebfe768881a (diff) | |
Avoid cast alignment warning in cache string view
The cache allocates strings as
uint16_t size;
char content[];
char zero;
Aligned to the uint16_t. When doing the casting, this causes a
warning on some architectures that cannot do unaligned loads, such
as armhf.
Use __builtin_assume_aligned() to explictly say that the pointer
is aligned to 16 bits. This is a bit of a backhanded approach,
as the warning seems to be actually avoided by the function
returning a void* rather than the assumed alignment, but this
is very much self-documenting.
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
0 files changed, 0 insertions, 0 deletions
