-1

It compiles on an intel/linux 64bit machine just fine..

But I need to have this compile and work to test for Big/Little Endian on a SunOS machine.. But its not compiling..

Here is the Error:
   util.h:48: error: expected `,' or `...' before '.' token

Here is The Header Portion of the declaration @ line 48:

 void addrFromHostname(const char* hostName, in_addr_t *s_addr);

Here is the CPP file of the function:

 void addrFromHostname(const char* hostName, in_addr_t *s_addr){
   struct hostent *server;
   server = gethostbyname(hostName);

   if (server == NULL) {
     fprintf(stderr,"ERROR, no such host as %s\n", hostName);
     exit(0);
   }

   bcopy((char *)server->h_addr, (char *)s_addr, server->h_length);
 }
John
  • 55
  • 1
  • 10
  • Search for possible `#define` or `#ifdef` different between linux and SunOS (`#ifdef LINUX` e.g.) and try to find syntax errors in one of that blocks. You might make your compiler to output and diff preprocessed code on both systems. – urzeit Mar 04 '14 at 16:41

2 Answers2

2

the declaration might be incorrect. It should be:

void addrFromHostname(const char* , in_addr_t*);

Check it out.

Alejandro Montilla
  • 2,626
  • 3
  • 31
  • 35
0

It looks like a syntax error somewhere before line 48, maybe a missing parenthesis or semicolon.

bjhend
  • 1,538
  • 11
  • 25