Snort mailing list archives

Re: numerous warnings when compiling snort 3.0.1 b2


From: "Russ Combs \(rucombs\) via Snort-devel" <snort-devel () lists snort org>
Date: Sun, 26 Apr 2020 22:51:39 +0000

Thanks Noah.  This is on our list.  Still.  ☹. It will be fixed before RC.

From: Snort-devel <snort-devel-bounces () lists snort org> on behalf of Noah Dietrich <noah_dietrich () 86penny org>
Date: Saturday, April 25, 2020 at 12:26 PM
To: "snort-devel () lists snort org" <snort-devel () lists snort org>
Subject: [Snort-devel] numerous warnings when compiling snort 3.0.1 b2

I am able to successfully compile and run snort 3.0.1 b2 from github.
However i am getting thousands of the same warning when running make:
warning: taking address of packed member of ‘snort::SfIp’ may result in an unaligned pointer value 
[-Waddress-of-packed-member]
(a sample is shown below).

Snort 3.0.1 b2 from github,
running on Ubuntu 20.04 x64
cmake version 3.16.3
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)

Steps performed:
cd ~/snort_src
git clone git://github.com/snortadmin/snort3.git<http://github.com/snortadmin/snort3.git>
cd snort3
./configure_cmake.sh --prefix=/usr/local --enable-tcmalloc
cd build
make
sudo make install

Results from ./configure:
-------------------------------------------------------
snort version 3.0.1

Install options:
    prefix:     /usr/local
    includes:   /usr/local/include/snort
    plugins:    /usr/local/lib/snort

Compiler options:
    CC:             /usr/bin/cc
    CXX:            /usr/bin/c++
    CFLAGS:            -fvisibility=hidden   -DNDEBUG -g -ggdb  -fno-builtin-malloc -fno-builtin-calloc 
-fno-builtin-realloc -fno-builtin-free
    CXXFLAGS:          -fvisibility=hidden   -DNDEBUG -g -ggdb  -fno-builtin-malloc -fno-builtin-calloc 
-fno-builtin-realloc -fno-builtin-free
    EXE_LDFLAGS:
    MODULE_LDFLAGS:

Feature options:
    DAQ Modules:    Static (afpacket;bpf;dump;fst;nfq;pcap;trace)
    Flatbuffers:    ON
    Hyperscan:      ON
    ICONV:          ON
    LZMA:           ON
    RPC DB:         Built-in
    SafeC:          ON
    TCMalloc:       ON
    UUID:           ON
-------------------------------------------------------


A tiny sample of the warnings i see:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/noah/snort_src/snort3/src/sfip/sf_cidr.h:24,
                 from /home/noah/snort_src/snort3/src/main/snort_config.h:37,
                 from /home/noah/snort_src/snort3/src/main.cc:40:
/home/noah/snort_src/snort3/src/sfip/sf_ip.h: In member function ‘const uint32_t* snort::SfIp::get_ip4_ptr() const’:
/home/noah/snort_src/snort3/src/sfip/sf_ip.h:137:12: warning: taking address of packed member of ‘snort::SfIp’ may 
result in an unaligned pointer value [-Waddress-of-packed-member]
  137 |     return &ip32[3];
      |            ^~~~~~~~
/home/noah/snort_src/snort3/src/sfip/sf_ip.h: In member function ‘const uint32_t* snort::SfIp::get_ip6_ptr() const’:
/home/noah/snort_src/snort3/src/sfip/sf_ip.h:142:12: warning: taking address of packed member of ‘snort::SfIp’ may 
result in an unaligned pointer value [-Waddress-of-packed-member]
  142 |     return ip32;
      |            ^~~~
/home/noah/snort_src/snort3/src/sfip/sf_ip.h: In member function ‘const uint32_t* snort::SfIp::get_ptr() const’:
/home/noah/snort_src/snort3/src/sfip/sf_ip.h:148:16: warning: taking address of packed member of ‘snort::SfIp’ may 
result in an unaligned pointer value [-Waddress-of-packed-member]
  148 |         return &ip32[3];
      |                ^~~~~~~~
/home/noah/snort_src/snort3/src/sfip/sf_ip.h:149:12: warning: taking address of packed member of ‘snort::SfIp’ may 
result in an unaligned pointer value [-Waddress-of-packed-member]
  149 |     return ip32;
      |            ^~~~
/home/noah/snort_src/snort3/src/sfip/sf_ip.h: In member function ‘SfIpRet snort::SfIp::_ip6_cmp(const snort::SfIp&) 
const’:
/home/noah/snort_src/snort3/src/sfip/sf_ip.h:311:10: warning: taking address of packed member of ‘snort::SfIp’ may 
result in an unaligned pointer value [-Waddress-of-packed-member]
  311 |     p1 = ip32;
      |          ^~~~
/home/noah/snort_src/snort3/src/sfip/sf_ip.h:312:14: warning: taking address of packed member of ‘snort::SfIp’ may 
result in an unaligned pointer value [-Waddress-of-packed-member]
  312 |     p2 = ip2.ip32;
      |          ~~~~^~~~
_______________________________________________
Snort-devel mailing list
Snort-devel () lists snort org
https://lists.snort.org/mailman/listinfo/snort-devel

Please visit http://blog.snort.org for the latest news about Snort!

Current thread: