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

  • Living is Easy (With Eyes Closed)

    This is really primarily for Cassie, but I rarely post here, so it's also an exercise in "how does LJ work again? Or how does it work today?".…

  • No mudslides for me, thank you.

    Hey, is this thing on? I was just sending email to a mailing list (nothing exciting, don't feel insulted if you're not on it) that was thinking…

  • Trivial

    So, this past weekend, a bunch of my friends / acquaintences / teammates got together and competed in a local trivia competition. There are a few…

  • 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