need help with clang

Hello to all,

WARNING: IF YOU ARE PROFESSIONAL PROGRAMMER PLEASE DONT READ THIS IT MAY BURN YOUR EYES

i tried to compile a code that isn’t compatible with clang, I want to know how to make it work and if not how to add a feature so that it will work?

It’s so I can learn to use LLVM and Clang better and contribute to the community, please pass the knowledge further.

for ( struct { int i; char* ptr; } loopy = { 0, “LLVM” };

loopy.i < 10 && * loopy.ptr != 0;

++ loopy.i, ++ loopy.ptr )

{ … }

Greets

This is probably better suited for Stack Overflow.

It looks like you're coming from some other language. Try this instead.

$ cat test.c
#include <stdlib.h>

struct loopy
{
  int i;
  char* ptr;
};

int main(int argc, char* argv)
{
  struct loopy loops =
  {
     {0, "LLVM"},
     {0, NULL}
  };

  for (struct loopy* ptr = loops;
       ptr->i < 10 && ptr->ptr != NULL;
       ++ptr)
  {
      /* ... */
  }

  return 0;
}

$ clang test.c -o test.exe
$ ./test.exe
$

Jeff