Skip to content

Avoid two definitions of getc() - #156

Open
rosenrost wants to merge 1 commit into
freemint:masterfrom
rosenrost:fix/avoid-two-definitions-of-getc
Open

rosenrost wants to merge 1 commit into
freemint:masterfrom
rosenrost:fix/avoid-two-definitions-of-getc

Conversation

@rosenrost

Copy link
Copy Markdown
Contributor

getc() was defined both in getc.c and as an alias of fgetc() in fgetc.c. Which one the linker picked depended on the order of the archive members.

getc() was defined both in getc.c and as an alias of fgetc() in
fgetc.c. Which one the linker picked depended on the order of the
archive members, and pulling in both objects causes a "multiple
definition" error. Use the alias with GCC and the function in getc.c
only for other compilers.
@rosenrost rosenrost closed this Nov 16, 2026
@rosenrost
rosenrost deleted the fix/avoid-two-definitions-of-getc branch November 16, 2026 15:21
@rosenrost
rosenrost restored the fix/avoid-two-definitions-of-getc branch November 16, 2026 15:24
@rosenrost rosenrost reopened this Nov 16, 2026
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.

1 participant