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

Re: C strstr function returns int or char *?



  you are probably missing the prototype, if there is no prototype for a
function, it defaults to an integer returning function.

  you might be missing the #include <string.h> line or for some reason
the __P is defined not to put prototype in its place (it depends on
compiler options).

  generally you'll get better answer to programming Qs in programming
related newsgroups/mailinglists/forums.

	erik

Brian May wrote:
> 
> >From the info page:
> 
> Function: char * strstr (const char *HAYSTACK, const char *NEEDLE)
> 
> >From /usr/include/string.h:
> 
> extern char *strstr __P ((__const char *__haystack, __const char *__needle));
> 
> While compiling:
> 
> char *a = strstr("hello", "ccache=");
> 
> Warning:
> 
> pam_krb5_auth.c:287: warning: initialization makes pointer from integer without a cast
> 
> So, why is an integer expected??????
> --
> Brian May <bam@debian.org>
> 
> --
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null



Reply to: