Skip to content

GCC + -Wpedantic throws warning about __int128 #222

@fzi-haxel

Description

@fzi-haxel

If the platform supports __int128, GCC throws the following warning if the -Wpedantic flag is set.

types.h:100:18: warning: ISO C does not support ‘__int128’ types [-Wpedantic]
  100 | typedef unsigned __int128 uECC_dword_t;

Here are three ways to avoid the GCC warning

  1. Use the __attribute__((mode(TI))) (similar to mbedtls)
typedef unsigned int uECC_dword_t __attribute__((mode(TI)));
  1. Use __extension__ GCC Documentation
__extension__ typedef unsigned __int128 uECC_dword_t;
  1. Just ignore -Wpedantic at this line
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
typedef unsigned __int128 uECC_dword_t;
#pragma GCC diagnostic pop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions