mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
After further examining the iffe code I found that fail{ ... }end
as well as pass{ ... }end blocks are executed in iffe's current
environment, using a simple 'eval', with no safeguards whatsoever!
This does of course afford maximum flexibility... for example, a
block can 'exit 1' to abort the iffe run and the whole build with
it. We can use this to abort properly on fatal compilation errors.
src/cmd/INIT/iffe.sh:
- Complete the fail{ and pass{ documentation; it should really be
known that they run in iffe's current environment.
- Make one change: for just the 'eval' command that runs these
blocks, redirect standard error back to the saved $stderr file
descriptor so these blocks can write error messages using the
standard >&2 instead of the undocumented >&$stderr.
src/lib/**/features/*:
- Write error message to standard error and error out properly when
an output{ ... }end block fails to compile, instead of writing an
#error directive to error out later.
This commit is contained in:
parent
2d3ec8b67a
commit
3fc6cf0e2f
8 changed files with 30 additions and 15 deletions
|
|
@ -319,7 +319,8 @@ tst - output{
|
|||
return 0;
|
||||
}
|
||||
}end fail{
|
||||
echo '#error Output block #2 in src/lib/libast/features/common failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.'
|
||||
echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1
|
||||
}end
|
||||
|
||||
tst - -DN=1 - -DN=0 output{
|
||||
|
|
|
|||
|
|
@ -890,7 +890,8 @@ tst - note{ missing floating point limits }end output{
|
|||
return 0;
|
||||
}
|
||||
}end fail{
|
||||
echo '#error Output block #1 in src/lib/libast/features/float failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.'
|
||||
echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1
|
||||
}end
|
||||
|
||||
tst - note{ double exponent bitfoolery }end output{
|
||||
|
|
@ -926,7 +927,8 @@ tst - note{ double exponent bitfoolery }end output{
|
|||
return 0;
|
||||
}
|
||||
}end fail{
|
||||
echo '#error Output block #2 in src/lib/libast/features/float failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.'
|
||||
echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1
|
||||
}end
|
||||
|
||||
tst - note{ long double exponent bitfoolery }end output{
|
||||
|
|
@ -962,7 +964,8 @@ tst - note{ long double exponent bitfoolery }end output{
|
|||
return 0;
|
||||
}
|
||||
}end fail{
|
||||
echo '#error Output block #3 in src/lib/libast/features/float failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.'
|
||||
echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1
|
||||
}end
|
||||
|
||||
tst - -DN=1 - -DN=2 note{ _ast_fltmax_t maximum integral type }end output{
|
||||
|
|
|
|||
|
|
@ -659,7 +659,8 @@ tst - output{
|
|||
}
|
||||
|
||||
}end fail{
|
||||
echo '#error The output block in src/lib/libast/features/lib failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.'
|
||||
echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1
|
||||
}end
|
||||
|
||||
tst no64 note{ largefile 64 broken }end execute{
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@ tst - note{ number of bits in pointer }end output{
|
|||
return 0;
|
||||
}
|
||||
}end fail{
|
||||
echo '#error The output block in src/lib/libast/features/sfio failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.'
|
||||
echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1
|
||||
}end
|
||||
|
||||
tst tmp_rmfail note{ open files cannot be removed }end execute{
|
||||
|
|
|
|||
|
|
@ -11,5 +11,6 @@ tst - note{ sizeof(integral-type) }end output{
|
|||
return 0;
|
||||
}
|
||||
}end fail{
|
||||
echo '#error The output block in src/lib/libast/features/sizeof failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.'
|
||||
echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1
|
||||
}end
|
||||
|
|
|
|||
|
|
@ -261,5 +261,6 @@ tst - -lm output{
|
|||
return 0;
|
||||
}
|
||||
}end fail{
|
||||
echo '#error The output block in src/lib/libdll/features/dll failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.'
|
||||
echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1
|
||||
}end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue