[Snort-users] Compilation Bug (Solaris 9, Snort 2.0.0, Sun CC)

Chris Green cmg at ...1935...
Tue May 20 07:27:05 EDT 2003


"Roy S. Rapoport" <snort-users at ...9230...> writes:

> A casual search of the mailing list did not reveal a previous report of
> this problem.
>
> Out of the box, snort compiles w/o problems using gcc (3.2.2) on my
> Solaris 9 box.  However, given that SunCC usually produces faster
> binaries, I attempted to compile with it, only to encounter

Please update to current CVS for the __FUNCTION__ problem

> ---
> cc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../src
> -I../../src/output-plugins -I../../src/detection-plugins
> -I../../src/preprocessors  -DBSD_COMP -I/usr/local/mysql/include/mysql
> -DENABLE_MYSQL  -xO5 -I/usr/local/include -c `test -f
> 'sp_pattern_match.c' || echo './'`sp_pattern_match.c
> "sp_pattern_match.c", line 254: warning: assignment type mismatch:
>         pointer to char "=" pointer to unsigned char

Change to (unsigned char *) casts on thopse pointers. If you really
want to earn brownie points, submit a diff and I will make it in for

[...]

>
> The important error there relates to __FUNCTION__, and specifically
> these lines in sp_pattern_match.c:
> ---
> #ifdef WIN32
> #define __FUNCTION__ "SetUseDoePtr"
> #endif 
>         LogMessage("%s: No pattern match data found\n", __FUNCTION__);
> #ifdef WIN32
> #undef __FUNCTION__
> #endif 
> ---
>
> Unfortunately, SunCC doesn't have a __FUNCTION__ macro either.  Removing
> the #ifdef/#endif lines and leaving jus 
> #define __FUNCTION__ "SetUseDoePtr"

#define __FUNCTION__ __func__ should work for you
>
>
> allowed me to continue compiling to this point:
> ---
> cc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../src  -I../src/output-plugins
> -I../src/detection-plugins -I../src/preprocessors  -DBSD_COMP
> -I/usr/local/mysql/include/mysql -DENABLE_MYSQL  -xO5
> -I/usr/local/include -c `test -f 'log.c' || echo './'`log.c
> "log.c", line 1578: syntax error before or at: {
> "log.c", line 1578: undefined symbol: __tmp

I believe that should be fixed in current CVS.
>

-- 
Chris Green <cmg at ...1935...>
 "Not everyone holds these truths to be self-evident, so we've worked
                  up a proof of them as Appendix A." --  Paul Prescod




More information about the Snort-users mailing list