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

Consider adding -std=c99 globally #5595

Open
magnumripper opened this issue Nov 30, 2024 · 3 comments
Open

Consider adding -std=c99 globally #5595

magnumripper opened this issue Nov 30, 2024 · 3 comments

Comments

@magnumripper
Copy link
Member

Currently (off the top of my head) the PRINCE mode and the new AES needs it. Perhaps we should just enable it globally. I don't care a lot but I think it would be nice.

@solardiz
Copy link
Member

solardiz commented Nov 30, 2024

If we have the dependency anyway, including in non-optional and non-arch-specific code such as PRINCE, then yes we should enable this globally. However, ideally we shouldn't try to add this option unless we know the compiler recognizes it, which means gcc starting with a certain version or compatible. Edit: OTOH, if it's a version of gcc so old it doesn't recognize the option, then it's also too old to build the code anyway, so for gcc we should probably add this option unconditionally.

@solardiz solardiz added this to the Potentially 2.0.0 milestone Dec 1, 2024
@magnumripper magnumripper self-assigned this Dec 2, 2024
magnumripper added a commit to magnumripper/john that referenced this issue Dec 2, 2024
magnumripper added a commit to magnumripper/john that referenced this issue Dec 2, 2024
magnumripper added a commit to magnumripper/john that referenced this issue Dec 2, 2024
-std=c99 breaks anonymous structs/unions with gcc-4 (only).

Closes openwall#5595
magnumripper added a commit to magnumripper/john that referenced this issue Dec 2, 2024
Using -std=c99 breaks anonymous structs/unions with gcc-4 (only).

Closes openwall#5595
@magnumripper
Copy link
Member Author

gcc 4.4 (only) does not allow anonymous structs/unions with -std=c99. According to this, "after gcc 4.4 --std=c89 and --std=c99 starting allowing anonymous unions/structs when this behaviour was otherwise only accepted with --std=gnu99, --std=c99 -fms-extensions or omitting a --std option entirely."

Using --std=gnu99 works fine, when supported.

@magnumripper
Copy link
Member Author

magnumripper commented Dec 2, 2024

While investigating this I also found out that strictly speaking, only int (plain, signed or unsigned) is allowed for bitfields. It's used with size_t in dyna_salt and needs to be larger than int. gcc seems to allow it regardless of --std option though, so I'm not changing it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants