Kalpanika / x3f

Tools for manipulating X3F files from Sigma cameras
88 stars 28 forks source link

Fix asserts with side-effects #119

Open Alex-Vasile opened 1 year ago

Alex-Vasile commented 1 year ago

This will fix the sigsev problems associated with #110. When doing a release build on Mac, the asserts do not seem to get complied. So none of the asserts would get called, leading to the issues described.

From my limited experience with C I've gather that it's safer to do side-effect/mutating operating outside of the assert and check the return in two steps.

Unrelated to this PR, but I plan on (at least trying to) fix some of the other open issues, especially the Merrill related ones.

mmroden commented 1 year ago

Thanks for this! What platforms do you suggest I test this against? Are you running on an intel or m1/2 mac? I can also test against linux.

Alex-Vasile commented 1 year ago

Thanks for this! What platforms do you suggest I test this against? Are you running on an intel or m1/2 mac? I can also test against linux.

Linux (and I think Windows) worked before, I see no reason it should stop after.

I'm testing it on an m1 Mac. Slowly working on getting GitHub actions for building and test, but that's going slowly.

Alex-Vasile commented 1 year ago

Thanks for this! What platforms do you suggest I test this against? Are you running on an intel or m1/2 mac? I can also test against linux.

Just to follow up, if you plan on testing on mac you to build natively. Cross-compiling Linux-to-mac does not produce this issue (see the last released version which works without problems).

It only shows up if you compile on mac for mac.