Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Irreconcilable compiler differences #383

Open
thomwiggers opened this issue Mar 16, 2021 · 2 comments
Open

Irreconcilable compiler differences #383

thomwiggers opened this issue Mar 16, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@thomwiggers
Copy link
Member

thomwiggers commented Mar 16, 2021

We keep running into differences between compilers and versions of compilers that make it hard to write code that a) just universally compiles and b) doesn't raise any compliants.

... about problems with _m256i having alignment requirements but _m256i_u not existing in certain versions of gcc / clang ...

The problem is that we want the PQClean code to compile with all the sensible warnings turned on, just copy/pasting code from a folder into your own project without thinking too much. That's obviously what enables having scripts such as the copy_from_pqclean.sh. Having to figure out what compiler warnings you have to turn off per scheme is just messy — and you need to do that for each individual compiler because AFAIK there's no way to disable them inline (cf. #[allow(warning)] in Rust).

I'm thinking more and more we should relax our #ifdef requirements. Perhaps it would be a good idea to have a compat.h file in common; this file could contain

#if GCC_VERSION < 9
  typedef _m256i_u _m256i;
#endif 

See also #382 (comment)

@thomwiggers thomwiggers added enhancement New feature or request help wanted Extra attention is needed labels Mar 16, 2021
@thomwiggers
Copy link
Member Author

thomwiggers commented Mar 16, 2021

A similar recurring issue is the need for a macro that handles appending _ to symbols used in assembly files for MacOS.

@thomwiggers
Copy link
Member Author

Along these lines: an align.h with ifdefs and compiler-specific attributes may also be interesting to clean up the alignment mess...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant