﻿# V124\. Function 'Foo' writes/reads 'N' bytes\. The alignment rules and type sizes have been changed\. Consider reviewing this value\.


> This rule belongs to the "Diagnosis of 64\\\-bit errors" group\\\. The rules in this group are no longer developed and may be disabled in the future\\\. If you use these rules, please \[contact our support team\]\(https://pvs\-studio\.com/en/about\-feedback/\)—we will help you find a replacement or suggest an alternative solution\\\.

The analyzer detected a potential error: the size of data being written or read is defined by a constant\.

When the code is compiled in the 64\-bit mode, the sizes of some data and their alignment boundaries will change\. The sizes of base types and their alignment boundaries are shown in the picture:

![V124/image1.png](https://import.viva64.com/docx/blog/V124/image1.png)

The analyzer examines code fragments where the size of data being written or read is defined explicitly\. The programmer must review these fragments\. Here is a code sample:

```cpp
size_t n = fread(buf, 1, 40, f_in);
```

Constant 40 may be an incorrect value from the viewpoint of the 64\-bit system\. Perhaps you should write it so:

```cpp
size_t n = fread(buf, 1, 10 * sizeof(size_t), f_in);
```