Skip to content

C front-end: tolerate type differences with asm renaming #7584

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions regression/ansi-c/asm4/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// from Fedora's glibc
struct dirent
{
int dummy;
};

struct dirent64
{
int dummy;
};

#ifdef __GNUC__
extern struct dirent *readdir(void *__dirp) __asm__(
""
"readdir64");
extern struct dirent64 *readdir64(void *__dirp);
#endif

int main()
{
#ifdef __GNUC__
int x;
(void)readdir(&x);
#endif
return 0;
}
8 changes: 8 additions & 0 deletions regression/ansi-c/asm4/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE test-c++-front-end
main.c

^EXIT=0$
^SIGNAL=0$
--
^warning: ignoring
^CONVERSION ERROR$
2 changes: 2 additions & 0 deletions src/ansi-c/c_typecheck_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ void c_typecheck_baset::apply_asm_label(
{
symbol.name=asm_label;
symbol.base_name=asm_label;
if(symbol.type.id() == ID_code)
Copy link
Member

Choose a reason for hiding this comment

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

An explaining comment would be great here.

symbol.type.set(ID_C_incomplete, true);
}

if(symbol.name!=orig_name)
Expand Down