Skip to content

Commit

Permalink
flex: 2.6.1 -> 2.6.3
Browse files Browse the repository at this point in the history
This resolves some warnings and errors introduced in 2.6.x.
  • Loading branch information
vcunat committed Dec 30, 2016
1 parent ee3fb42 commit 6bded45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
7 changes: 4 additions & 3 deletions pkgs/development/tools/parsing/flex/default.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{ stdenv, fetchurl, bison, m4 }:

stdenv.mkDerivation rec {
name = "flex-2.6.1";
name = "flex-${version}";
version = "2.6.3";

src = fetchurl {
url = "https://github.com/westes/flex/releases/download/v2.6.1/flex-2.6.1.tar.gz";
sha256 = "0fy14c35yz2m1n1m4f02by3501fn0cca37zn7jp8lpp4b3kgjhrw";
url = "https://github.com/westes/flex/releases/download/v${version}/flex-${version}.tar.gz";
sha256 = "1an2cn2z85mkpgqcinh1fhhcd7993qm2lil1yxic8iz76ci79ck8";
};

buildInputs = [ bison ];
Expand Down
4 changes: 0 additions & 4 deletions pkgs/os-specific/linux/libsepol/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ flex ];

# Temporary work-around for problems after flex security update:
# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=835542
NIX_CFLAGS_COMPILE = "-Wno-error=sign-compare";

preBuild = ''
makeFlagsArray+=("PREFIX=$out")
makeFlagsArray+=("DESTDIR=$out")
Expand Down

4 comments on commit 6bded45

@dezgeg
Copy link
Contributor

@dezgeg dezgeg commented on 6bded45 Jan 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this broke building of grub:

gcc -DHAVE_CONFIG_H -I.  -Wall -W -DGRUB_UTIL=1 -D_FILE_OFFSET_BITS=64 -I./include -DGRUB_FILE=\"grub_script.yy.c\" -I. -I. -I. -I. -I./include -I./include -I./grub-core/lib/libgcrypt-grub/src/  -I./grub-core/lib/minilzo -I./grub-core/lib/xzembed -DMINILZO_HAVE_CONFIG_H -D_FILE_OFFSET_BITS=64 -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Werror  -fno-builtin -Wno-undef  -c -o libgrubmods_a-grub_script.yy.o `test -f 'grub_script.yy.c' || echo './'`grub_script.yy.c
./grub-core/script/yylex.l:34:0: error: "yyalloc" redefined [-Werror]
 #define yyalloc(size, scanner)   (grub_malloc((size)))
 ^
grub_script.yy.c:104:0: note: this is the location of the previous definition
 
 ^
./grub-core/script/yylex.l:35:0: error: "yyfree" redefined [-Werror]
 #define yyfree(ptr, scanner)   (grub_free((ptr)))
 ^
grub_script.yy.c:108:0: note: this is the location of the previous definition
 
 ^
./grub-core/script/yylex.l:36:0: error: "yyrealloc" redefined [-Werror]
 #define yyrealloc(ptr, size, scanner) (grub_realloc((ptr), (size)))
 ^
grub_script.yy.c:106:0: note: this is the location of the previous definition
 
 ^
cc1: all warnings being treated as errors
make[2]: *** [Makefile:7540: libgrubmods_a-grub_script.yy.o] Error 1

@vcunat
Copy link
Member Author

@vcunat vcunat commented on 6bded45 Jan 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I've seen that. I haven't notified upstream(s) yet. I suppose we can work around this for now, perhaps by having multiple flex versions or by some -Wno-error...

@dezgeg
Copy link
Contributor

@dezgeg dezgeg commented on 6bded45 Jan 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think we can (barely) manage with -Wno-error, the order that happens in the generated file is:

     #define yyalloc yyalloc
void *yyalloc ( yy_size_t , yyscan_t yyscanner );
#define yyalloc(size, scanner)   (grub_malloc((size)))

...with no uses of yyalloc in the problematic section (between 2-3).

@dezgeg
Copy link
Contributor

@dezgeg dezgeg commented on 6bded45 Jan 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked around in be2a2db.

Please sign in to comment.