discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Weird warning


From: Chris B. Vetter
Subject: Weird warning
Date: Tue, 18 Mar 2003 12:29:27 -0800

Hi,

I just ran into a - to me - weird warning after moving a C function
from a class file to an 'external' *.c file.

In foobar.h I define a prototype

  BOOL initPattern(char **pattern, BOOL flag);

Now, in Foobar.m

#include "foobar.h"

[...]

- (id) initWithPattern: (NSString *) pattern
         caseSensitive: (BOOL) flag
{
  char
    *pat = (char *) [pattern cString];
  [...]

  if( TRUE == initPattern(&pat, flag) )
  {
    [...]

    return self;
  }

  return nil;
}

When I try to compile everything, however, I get a

  warning: passing arg 1 of `initPattern' from incompatible pointer type

The weird thing is, that it compiles (and works ;-) without problem if
initPattern() is a 'static' function in Foobar.m... ?!?

Any ideas what might be wrong?

-- 
Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]