-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
ABIApplication Binary InterfaceApplication Binary InterfacebugzillaIssues migrated from bugzillaIssues migrated from bugzillamiscompilation
Description
| Bugzilla Link | 2533 |
| Resolution | FIXED |
| Resolved on | Mar 06, 2010 13:59 |
| Version | unspecified |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @asl |
Extended Description
#include <stdio.h>
#include <inttypes.h>
void dummy(const char* a) {}
typedef struct {
const char *name;
int flags;
union {
void (*func_arg)(const char *); //FIXME passing error code as int return would be nicer then exit() in the func
} u;
} OptionDef;
const OptionDef options[] = {
/* main options */
{ "a", 0, {dummy} },
{ "b", 0, {dummy} },
{ 0, },
};
int main(int argc, char *argv)
{
const OptionDef po;
for (po=options; po->name!=0; po++) {
printf("%s\n", po->name);
}
return 0;
}
This code should iterate over all elements in 'options'. The code generated with llvm-gcc (2.3 stable) however, does not do this. When compiled with gcc, everything works as expected. On x86_32, llvm-gcc generates correct code.
Metadata
Metadata
Assignees
Labels
ABIApplication Binary InterfaceApplication Binary InterfacebugzillaIssues migrated from bugzillaIssues migrated from bugzillamiscompilation