Dave LeCompte (really) (tsmaster) wrote,
Dave LeCompte (really)
tsmaster



So, I've got this coworker. Maybe he's an idiot. I want to say the jury's still out.

We're using this super brittle compiler for our current project, and we bump into behavior that's summed up by a tiny test case here. Consider this code as an entire project:

extern void bar();

void foo()
{
  bar();
}

int main()
{
  return 0;
}


In my coworker's estimation, this code should not link. You've got foo calling an undefined extern, bam, it's no good. In my opinion, nobody's calling foo, nobody's calling bar, it's just fine.

At one point, he's trying to convince me of his point of view, and he says that no reputable compiler would behave the way I describe. Microsoft's compiler doesn't. GNU's compiler doesn't. I say that it seems fine. Microsoft plays fast and loose with language specifications, so I don't consider them a standard to judge by.

Turns out, the guy's wrong - MS and GNU behave differently. And our flaky new compiler works the same way GNU's compiler does.

"no reputable compiler". Please, let's not stoop to insults.


Subscribe
  • Post a new comment

    Error

    Comments allowed for friends only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 4 comments