fread
reads the data "as is" into memory, therefore your code will definitely behave differently on a big endian CPU than on a little endian CPU.
In other words fread
does not know that you are reading a uint32_t
. All fread
knows is that you want to read 4 bytes to the memory location where the fileSize
variable lives.