Skip to content
Snippets Groups Projects
  • Gaëtan Harter's avatar
    939ca4e1
    drivers/sdcard_spi: fix uint64_t cast location · 939ca4e1
    Gaëtan Harter authored
    When compiling `tests/drivers_sdcard_spi` with `avr-gcc: avr-gcc (GCC) 6.4.0`
    it detected this error
    
        RIOT/drivers/sdcard_spi/sdcard_spi.c:1012:72:
        error: result of '512 << 10' requires 21 bits to represent, but 'int' only has 16 bits [-Werror=shift-overflow=]
        return (card->csd.v2.C_SIZE + 1) * (uint64_t)(SD_HC_BLOCK_SIZE << 10);
    939ca4e1
    History
    drivers/sdcard_spi: fix uint64_t cast location
    Gaëtan Harter authored
    When compiling `tests/drivers_sdcard_spi` with `avr-gcc: avr-gcc (GCC) 6.4.0`
    it detected this error
    
        RIOT/drivers/sdcard_spi/sdcard_spi.c:1012:72:
        error: result of '512 << 10' requires 21 bits to represent, but 'int' only has 16 bits [-Werror=shift-overflow=]
        return (card->csd.v2.C_SIZE + 1) * (uint64_t)(SD_HC_BLOCK_SIZE << 10);