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

Fix libc complaining about invalid printf string #12649

Merged
merged 1 commit into from Jun 13, 2015

Conversation

Projects
None yet
3 participants
@BevapDin
Copy link
Contributor

commented Jun 13, 2015

This has been reported at http://smf.cataclysmdda.com/index.php?topic=10419.msg236893#msg236893 and http://smf.cataclysmdda.com/index.php?topic=10477.0 (I believe they stem from the same bug).

A bug report that explains the problem: https://bugs.launchpad.net/ubuntu/+source/gcc-4.4/+bug/547016

Reproducible with gcc 5.1.0 and -O3 and -D_FORTIFY_SOURCE=2, it woks "fine" (does not crash) without any -O flag, and also with -D_FORTIFY_SOURCE=0.

Fix libc complaining about invalid printf string
Apparently one must not leave all positional parameters in the printf format.
@tvm1

This comment has been minimized.

Copy link

commented on 3ecd65d Jun 13, 2015

Thanks for fixing that.

Grepping through the sources, it seems that this is not the only instance of this problem.

This comment has been minimized.

Copy link
Owner Author

replied Jun 13, 2015

Thanks for fixing that.

Well, it was new for me, too. So I've learned something (-:

Grepping through the sources, it seems that this is not the only instance of this problem.

Where else does it happen? I checked the sources as well, but didn't found any similar problem.

@tvm1

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2015

Where else does it happen? I checked the sources as well, but didn't found any similar problem.

Ah, sorry my bad, it works everywhere now.

All the functions seem to actually use the passed arguments for both player & NPC , so it works even with -O

@Coolthulhu Coolthulhu self-assigned this Jun 13, 2015

Coolthulhu added a commit that referenced this pull request Jun 13, 2015

Merge pull request #12649 from BevapDin/foi
Fix libc complaining about invalid printf string

@Coolthulhu Coolthulhu merged commit 79a2ecd into CleverRaven:master Jun 13, 2015

1 check passed

default This has been rescheduled for testing as the 'master' branch has been updated.

@BevapDin BevapDin deleted the BevapDin:foi branch Jun 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.