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

Don't include printf %m support #8133

Merged
merged 4 commits into from
Feb 21, 2019
Merged

Don't include printf %m support #8133

merged 4 commits into from
Feb 21, 2019

Conversation

kripken
Copy link
Member

@kripken kripken commented Feb 20, 2019

It's a gnu libc extension, which uses strerror, which brings in 2.5K of strings in any program that uses printf.

Simple hello world doesn't hit this, as printf("hello, world!\n"); is optimized to puts. But any program where printf survives the optimizer, even printf("%d\n", num);, did get this extra 2.5K... (edit: which was almost 15% of the size)

…es strerror, which brings in 2.5K of strings in any program that uses printf
@@ -595,8 +595,10 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
*(a=z-(p=1))=arg.i;
fl &= ~ZERO_PAD;
break;
#ifndef __EMSCRIPTEN__ // 'm' is a gnu extension, and strerror brings in 2.5K of strings
case 'm':
if (1) a = strerror(errno); else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have I mentioned that I think vfprintf is particularly kooky?

@kripken kripken merged commit 4c1836c into incoming Feb 21, 2019
@kripken kripken deleted the small branch February 21, 2019 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants