Skip to content

Commit

Permalink
add GCC option -fno-strict-aliasing
Browse files Browse the repository at this point in the history
  • Loading branch information
idning committed Nov 14, 2014
1 parent 591b25e commit 1f17bc1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@ To build nutcracker from [distribution tarball](http://code.google.com/p/twempro
$ make
$ sudo make install

To build nutcracker from source with _debug logs enabled_ and _assertions disabled_:
To build nutcracker from source with _debug logs enabled_ and _assertions enabled_:

$ git clone git@github.com:twitter/twemproxy.git
$ cd twemproxy
$ autoreconf -fvi
$ ./configure --enable-debug=log
$ ./configure --enable-debug=full
$ make
$ src/nutcracker -h

Few checklists:

+ use newer version of gcc (older version of gcc has problems)
+ use CFLAGS="-O1" ./configure && make
+ use CFLAGS="-O3 -fno-strict-aliasing" ./configure && make

## Features

+ Fast.
Expand Down
4 changes: 3 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ AM_CPPFLAGS += -I $(top_srcdir)/src/proto
AM_CPPFLAGS += -I $(top_srcdir)/src/event
AM_CPPFLAGS += -I $(top_srcdir)/contrib/yaml-0.1.4/include

AM_CFLAGS =
AM_CFLAGS =
# about -fno-strict-aliasing: https://github.com/twitter/twemproxy/issues/276
AM_CFLAGS += -fno-strict-aliasing
AM_CFLAGS += -Wall -Wshadow
AM_CFLAGS += -Wpointer-arith
AM_CFLAGS += -Winline
Expand Down

0 comments on commit 1f17bc1

Please sign in to comment.