torognes / swarm

A robust and fast clustering method for amplicon-based studies
GNU Affero General Public License v3.0
123 stars 23 forks source link

Function fatal() declared twice #85

Closed frederic-mahe closed 8 years ago

frederic-mahe commented 8 years ago

I was checking the return status if SSE2 is not available and I noticed that the fatal() function is defined twice in util.cc:

void fatal(const char * msg)
{
  fprintf(stderr, "\nError: %s\n", msg);
  exit(1);
}

void fatal(const char * format, const char * message)
{
  fprintf(stderr, "\n");
  fprintf(stderr, format, message);
  fprintf(stderr, "\n");
  exit(1);
}
frederic-mahe commented 8 years ago

That's the same thing in vsearch. Maybe that's normal?

torognes commented 8 years ago

Yes, it is perfectly ok. They are two different functions with the same name, but different number of arguments. The correct function is selected based on the number and types of arguments.

frederic-mahe commented 8 years ago

Thanks, I didn't know this was possible.