for a 'mostly single-threaded' application this
doesn't happen and the cpus stays at 1.6GHz instead of increasing
to 3.4GHz.
Running 'while :; do :; done' once for eacg cpu makes the program
run faster!
David
--
David Laight: da...@l8s.co.uk
to work for windows console programs in mintty windows.)
David
--
David Laight: da...@l8s.co.uk
see
why the above would compile to different code at any sane
optimisation level - best to look at the object code.
Unless the compiler knows that out[] can't overlap a[] or b[] the
generated code is likely to be better if 't' is evaluated before
the write to out[1].
David
--
David Laight
On Thu, Feb 28, 2013 at 01:53:25PM -0800, Andy Lutomirski wrote:
O_DENYMAND - to switch on/off three flags above.
O_DENYMAND doesn't deny anything. Would a name like O_RESPECT_DENY be
better?
Possibly rename to O_CHECK_DENY ?
David
--
David Laight: da...@l8s.co.uk
is possible the compiler has sequence the code to
ensure the writes and reads happen in the correct order.
That function probably has too many live values for the normal
registers - so some values will get flushed to stack.
SSE might be better.
David
--
David Laight: da...@l8s.co.uk
is 'packed'
(or similar).
David
--
David Laight: da...@l8s.co.uk
compiler manages to obtain exclusive access
to the source files - stopping the other systems from reading them.
David
--
David Laight: da...@l8s.co.uk
mail program (which, for some reason I
don't understand) assumes UTF-8 do drop core responsing to mails!
David
--
David Laight: da...@l8s.co.uk
a pig's breakfast.
David
--
David Laight: da...@l8s.co.uk
.
(This is a MIPS-like embedded cpu.)
David
--
David Laight: da...@l8s.co.uk
to do so.
We've just gone through a series of hoops in NetBSD trying to fix
gcc to generate code that doesn't assume 16 byte aligned stack and
doesn't fault internally.
David
--
David Laight: da...@l8s.co.uk
return 16 byte aligned memory.
But I bet some i386 ones don't.
Especially since gcc is quite capable of suddently using the
SSE2 (etc) instructions that require such alignment.
David
--
David Laight: da...@l8s.co.uk
(or compiled with other options)
can lose that alignment.
If you request 32 byte alignment for the save area, (recent enough) gcc
will align the stack before allocating the locals.
David
--
David Laight: da...@l8s.co.uk
*' (only to 'foo * const').
David
--
David Laight: da...@l8s.co.uk
On Wed, Oct 10, 2012 at 10:42:53AM +0200, joerg-cyril.hoe...@t-systems.com
wrote:
Hi,
David Laight wrote:
Better to code as:
status = wmm-dwStatus;
if (...)
Incidentally, that's what I did tonight in patch 20/25 try 2.
but even then I think the compiler is allowed
if.
The memory constraint of the asm statement tells gcc that it might
change any memory location - thus acting as a barrier.
The only portable way is with volatile.
David
--
David Laight: da...@l8s.co.uk
that these two calls are equivalent:
printf(int %d, fp %f\n, 2, 3.15159);
printf(int %d, fp %f\n, 3.15159, 2);
the va_arg() processing has to remember which registers have already
been processed in order to know where to find the next argument.
David
--
David Laight: da
[offsetof(struct a, b[3])];
David
--
David Laight: da...@l8s.co.uk
) | \
+ (((_x) 0xff) 8) |\
+ (((_x) 0xff00) 24) )
You shouldn't really define macros that expand their arguments
multiple times.
David
--
David Laight: da...@l8s.co.uk
' (or the pointer to 'unsigned char *').
David
--
David Laight: da...@l8s.co.uk
Does wine support running of 16bit windows apps?
If so does it rely on the underlying OS having support
for 'virtual 8086 emulation'?
I'm thinking of removing the VM86 support from NetBSD,
and wine is about the only likley user.
David
--
David Laight: da...@l8s.co.uk
On Tue, May 08, 2012 at 12:03:52PM +0200, Damjan Jovanovic wrote:
On Tue, May 8, 2012 at 11:40 AM, David Laight da...@l8s.co.uk wrote:
Does wine support running of 16bit windows apps?
If so does it rely on the underlying OS having support
for 'virtual 8086 emulation'?
I'm thinking
http://www.hermetic.ch/cal_stud/cal_art.html for some
info about which years were/are actually leap years ...
David
--
David Laight: da...@l8s.co.uk
them into an on-stack array.
David
--
David Laight: da...@l8s.co.uk
to remember
which register args have been processed.
This is all somewhat tricky! and makes support for printf's argument
order selection stuff extremely difficult to write!
David
--
David Laight: da...@l8s.co.uk
other issues (like accidentally casting a pointer type).
David
--
David Laight: da...@l8s.co.uk
is supposed to take care of errno.
I'm also not at all sure of the portability of using syscall() in
application code.
What happens when you try to run the above on anything other than Linux?
(Eg aone of the BSDs)
David
--
David Laight: da...@l8s.co.uk
' would be a better name.
also
unsigned intfoo:1;
please. (int foo:1 works, but is semidefined only ;)
Why the bitfield anyway?
Unless you are allocating a lot of copies of the structure
it is likely to generate more code than the saved memory.
David
--
David Laight: da
and pdp11) arranged for address
zero to contain zero (possibly as part of the program header) so
that 'if (x *x)' could be shortened to 'if (*x)'.
Allowing address zero be mapped (eg by mmap()) is a bad idea
as a kernel 'call through NULL ptr' can be used to escalate
privs.
David
--
David
.
(Or is that really glibc only?)
Probably glibc, solaris was one of the first unix (I saw) to fault
on accesses to address zero and certainly the current solaris libc
will fault.
David
--
David Laight: da...@l8s.co.uk
On Mon, Aug 29, 2011 at 06:43:41PM -0700, Alan W. Irwin wrote:
double x;
while(fscanf(stdin, %le , x) == 1)
You are using the wrong format, %le is for 'long double', this will
probably overwrite too much data.
David
--
David Laight: da...@l8s.co.uk
during autocomplete, that's ok.
gcc itself can also deal with a trailing / for -B, it's kinda
suprising, if this breaks in winegcc.
bash has 'broken' many things by doing that.
Traditionally directory paths wouldn't be expected to have a trailing '/'.
David
--
David Laight: da
a_bit:1 } test;
test.an_int=0;
test.a_bit=1;
...
There are 4 likely values for test.an_int (1, 0x80, 0x8000, 0x0100),
and all might be generated regardless of the system endianness.
David
--
David Laight: da...@l8s.co.uk
it!)
It is also worth noting that some architectures (eg ppc) have instructions
for reading and writing memory with byteswap, but no instruction for
swapping a register. Newer gccs can be taught how to use these instructions
for specific source sequences.
David
--
David Laight: da...@l8s.co.uk
to the offsets returned by the OS.
Directory offsets aren't necessarily byte offsets.
(They may be 64bit values even for small directories.)
David
--
David Laight: da...@l8s.co.uk
) - not a pointer to an array of addresses.
IIRC the 'something' will be an IPv4 address - which might
be held as a 32 bit quantity rather that an array of char.
But nowhere should you cast the 32bit int (DWORD) to/from a pointer type.
David
--
David Laight: da...@l8s.co.uk
)/sizeof(CHAR));
+strcpy(buff, x);
What is wrong with:
buff[0] = 'x';
buff[1] = 0;
David
--
David Laight: da...@l8s.co.uk
returns IPv4 addresses, i.e.
ones that can fit in a DWORD.
That doesn't sound like a problem that would give that warning.
David
--
David Laight: da...@l8s.co.uk
implemenations
which will fault.
David
--
David Laight: da...@l8s.co.uk
The 0x should be 0xu
David
--
David Laight: da...@l8s.co.uk
.
David
--
David Laight: da...@l8s.co.uk
that an elf program's 'main' can be in a
shared object! This mightmake it easier to write a stub binary
that effectively make a .so executable.
Sort of depends on what the guy way tring to do...
David
--
David Laight: da...@l8s.co.uk
not taken) in the 'return -1' path.
David
--
David Laight: da...@l8s.co.uk
.
David
--
David Laight: da...@l8s.co.uk
it is likely to be absent (unless you are doing
a lot of lookups together).
David
--
David Laight: da...@l8s.co.uk
requires that the compiler use stricter data aliasing rules
than are required by the C standard.
Using a union is ok (but you must write and read a union variable,
not just cast to a union type.
David
--
David Laight: da...@l8s.co.uk
provided that there are only 2 encoding patterns for zero.
David
--
David Laight: da...@l8s.co.uk
,
David
--
David Laight: da...@l8s.co.uk
cygwin on windoes 7.
David
--
David Laight: da...@l8s.co.uk
}/dosdevices/c:/Program Files
which will generate an error if HOME isn't set.
David
--
David Laight: da...@l8s.co.uk
for locating interpreters for e.g. Python as well.
It does depend on 'env' being installed in a standard place!
It is also rather a side effect of env's real purpose - sanitising
the environment.
David
--
David Laight: da...@l8s.co.uk
in the NEEDED entries (the value comes from
the soname property of the library found when linking the program.
This is usually just foo.so, but can contain directory names.
David
--
David Laight: da...@l8s.co.uk
;
+ __ms_va_list valist = xvalist;
You can't copy a valist. This needs to be integrated properly with the
other printf functions.
Well, you can if you can find a va_copy() function .
David
--
David Laight: da...@l8s.co.uk
if you try to copy from a
misaligned pointer into a local variable (strictly, in valid C, you
can never get a misaligned pointer - and the compiler will use
word accesses).
David
--
David Laight: da...@l8s.co.uk
*this, size_t pos, size_t len)
{
-TRACE(%p %d %d\n, this, pos, len);
+TRACE(%p %d %d\n, this, (int)pos, (int)len);
You should be casting to long, otherwise you'll potentially truncate the
value.
In which case the format specifiers need to be %ld as well...
David
--
David
.
Clearly it should be:
mixdev[mixnum].chans += !!mastelem + !!headelem + !!pcmelem + (micelem
!mastelem !captelem);
ducks quickly ... :-)
David
--
David Laight: da...@l8s.co.uk
of using 'inline' for something that size.
David
--
David Laight: da...@l8s.co.uk
.
David
--
David Laight: da...@l8s.co.uk
are different - the single byte opcodes for
inc/dec register are reallocated for other uses. So you cannot just
load 32bit code into a 64bit binary and expect anything sane to happen.
--
David Laight: da...@l8s.co.uk
of address 0 some time
in the near future - it does have problems with the compatibility code
for other unix system binariess though (I can't remember which ones,
compat-ultrix might be the one).
David
--
David Laight: da...@l8s.co.uk
--
David Laight: da...@l8s.co.uk
will be LONG_MIN or LONG_MAX and
errno is set to ERANGE. No other errno values should appear.
I thought that the only 'size' difference is that 64bit windows has a
32bit long ?
So values outside 32bits need truncating and ERANGE set ??
David
--
David Laight: da...@l8s.co.uk
On Sat, Aug 15, 2009 at 07:37:12PM +0200, Henri Verbeet wrote:
2009/8/15 Rico Sch?ller kgbric...@web.de:
+static inline void parse_annotation(const char **ptr, unsigned int count)
^^
And there is no reason to inline something this size
David
--
David Laight: da
On Fri, Jul 17, 2009 at 07:27:11PM -0500, John Klehm wrote:
Oops I guess SHGetFolderPath is more portable (win95 and up)
It is just a pain getting the right include file and library,
especially on win2k with oldish versions of visual C.
David
--
David Laight: da...@l8s.co.uk
number.
David
--
David Laight: da...@l8s.co.uk
returned by
lseek() for directories isn't necessarily a byte offset.
David
--
David Laight: da...@l8s.co.uk
to
target Win16 (not likely) or write a whole new compiler toolchain to target
Win16/DOS, there really isn't anything else left to use.
Will 'Bruce's C Compiler' target DOS/Win 16 ?
David
--
David Laight: da...@l8s.co.uk
don't know
if it still works :-)
David
--
David Laight: da...@l8s.co.uk
first.
And on a multi-processor system they are likely to both run.
So I'd guess that warpatch.bin or broken.
David
--
David Laight: da...@l8s.co.uk
).
(In particular when one user thread wakes another, it can be pre-empted
entirely in userspace.)
NetBSD 5 uses a 1:1 thread library due to intractable problems on SMP
systems.
David
--
David Laight: da...@l8s.co.uk
fixed.
There is no need for the shell itself to pre-process process input/output.
There are no control sequences for the shell.
(^C etc are detected by the kernel line-discipline code and sent as signals
to the session leader.)
David
--
David Laight: da...@l8s.co.uk
--
David Laight: da...@l8s.co.uk
', and thus would likely be so upset if 'long' where ever to
change size that they might commit suicide in droves. So they decided
that 'long' would remain 32bits.
Not only Windows application programmers
What type to you think PDWORD_PTR is ?
David
--
David Laight: da...@l8s.co.uk
The problem is that nan_magic_pattern would have to be 8 bytes and AFAIK
there is no portable way to do it without ugly casts like in attached patch.
And that break C's 'strict aliasing' rules that gcc might apply
when optimising code.
David
--
David Laight: [EMAIL PROTECTED]
variable whose value is a
always zero to the format string is enough.
David
--
David Laight: [EMAIL PROTECTED]
always warns about and || - where the order
is obvious and correctly defined.
Blindly putting parenthesis around conditional expressions leads people
to write:
dwMediaTypeSize + (dwMediaTypeSize 2) ? 1 : dwMediaTypeSize / 2
which is unlikely to have the desired effect!
David
--
David
--
David Laight: [EMAIL PROTECTED]
.
Sure, it's messy until the filesystem is unicode internally, and uses
something more reasonable instead of a multibyte UTF-8.
Unix filesystems treat filenames as byte-strings, this is 100% reasonable :-)
Any conversion to glygps isn't a filesyatem operation.
David
--
David Laight
*)((char *)(elem) - (unsigned long)(((type *)0)-field)))
How about:
((type *)((char *)(elem) - ((char *)(((type *)0)-field) - (char *)0)))
David
--
David Laight: [EMAIL PROTECTED]
, file).
Discovered on a semi-embedded system which had fprintf, but not fputs :-)
David
--
David Laight: [EMAIL PROTECTED]
, as is (void *)0
There's no heuristic involved here, the assignment is clearly to a
pointer, and 0 is a perfectly valid null pointer, no cast is needed.
As is 1-1, or any other compile time integer expression with a numeric
vaule of zero.
David
--
David Laight: [EMAIL PROTECTED]
who may not have been obeying the
general spirit of the GPL, but also people writing software that
is BSD licensed are worried about having GPL3 utilities
included in a software release, and having GPL3 source residing in
the local CVS tree.
David
--
David Laight: [EMAIL PROTECTED]
of the union
can be immediately read from the other.
David
--
David Laight: [EMAIL PROTECTED]
that caused a terminal to send back its identification sequence.
Running 'ls' caused keyboard input
David
--
David Laight: [EMAIL PROTECTED]
On Sun, Jul 01, 2007 at 02:57:58AM +0200, J?r?me Gardou wrote:
All I know is that wine shouldn't use * and ? , since it is used in wildcards
on both Unix and Windows !
But they are not illegal in unix filenames.
Only 2 byte values cannot be used, 0 and '/'.
David
--
David Laight
anyway).
David
--
David Laight: [EMAIL PROTECTED]
is 'uint32_t' - and should be defined by inttypes.h
David
--
David Laight: [EMAIL PROTECTED]
sector do the games
think they can access? Especially for write ?
Having written the mbr code that NetBSD uses - which could validly be
in sector zero of the boot disk of a windows systesm - I'm not at all
certain there any bytes that can usefully be used.
David
--
David Laight: [EMAIL
isizeof (void)sizeof
David
--
David Laight: [EMAIL PROTECTED]
not used' warning instead.
What you really don't want to do is allow casts from 'int' to 'foo *'.
After all casting from 'foo *' to 'bar *' is easy.
David
--
David Laight: [EMAIL PROTECTED]
); } while (*str++);
return 0;
}
David
--
David Laight: [EMAIL PROTECTED]
tends to cause internal compiler errors.
David
--
David Laight: [EMAIL PROTECTED]
' particularly slow.
I'm not even sure what the break-even length for the one is!
Sequence like (give or take assembler syntax):
mov %eax,(%esi+%ecx-4)
mov (%edi+%ecx-4),%eax
shrl $2, %ecx
rep movsl
should be better given large enough %ecx
David
--
David
on NetBSD, however chances are the build has broken
over time due to lack of testing. I suggest you try building it and see
what happens.
There has been a working version in pkgsrc, but I suspect it is old.
David
--
David Laight: [EMAIL PROTECTED], [EMAIL PROTECTED]
, buff = ab0
_snprintf(buff, 3, abcd ) returns -1, buff = ab0
but:
_snprintf(buff, 3, abc ) returns 3, buff = abc
without NUL terminating the string.
Do you replicate that?
David
--
David Laight: [EMAIL PROTECTED]
(ptr))
Or:
static inline void *deconst(const void *p)
{
return ((const char *)p - (const char *)0) + (char *)0;
}
David
--
David Laight: [EMAIL PROTECTED]
unique inode numbers.
(There is no answer to the problem though)
David
--
David Laight: [EMAIL PROTECTED]
that solaris uses kernel LWPs for threads.
If you give ps the correct incantation it wil show them.
David
--
David Laight: [EMAIL PROTECTED]
of %ecx
David
--
David Laight: [EMAIL PROTECTED]
On Sat, Dec 20, 2003 at 08:57:29PM +0100, Ferenc Wagner wrote:
David Laight [EMAIL PROTECTED] writes:
BTW, there's no need to make the script bash specific,
we can use expr instead:
-i=$(($i+1))
+i=`expr $i + 1`
That isn't a bashism, it is required to be supported
1 - 100 of 103 matches
Mail list logo