\nif ((tp = gettosbyname("interactive", "tcp")) &&\n (setsockopt(f, IPPROTO_IP, IP_TOS, &tp->t_tos, sizeof(int)) < 0))\n
If that code was somehow getting ifdeffed in (I don't think it should on Linux) then the two messages you list could make sense.
The warning could result from the compiler not having a prototype for gettosbyname and defaulting to returning int, which then triggers the warning of trying to convert the int result to a pointer (tp)
The error could then be explained by the derefencing of the tp pointer in the setsockopt call before the struct type had been fully specified (the struct tosent *tp; line would in effect be a forward declaration that never got completed before it was used because the compiler doesn't know what "struct tosent" is).