public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* bug?
@ 2001-06-15 15:57 Ben Kohlen
  2001-06-15 16:38 ` bug? David Berthelot
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Ben Kohlen @ 2001-06-15 15:57 UTC (permalink / raw)
  To: gcc-help

I am expecting that when I shift right, I will always
get zeroes in from the left, but when I use data types
less than 32 bits, this is not always the case.

Example:
...
unsigned short s = 0xcc55;
printf("%x\n", (s<<8)>>8);
...
yeilds the output "cc55" where as I was expecting
"55".

I was expecting this to be equivalent to:
...
s = s << 8;
s = s >> 8;
...
in which you do explicit assignment, which does yeild
"55" as the output.

Is this part of C spec, unspecified by C, or actually
a gcc bug?

gcc version 2.95.3 20010315 (release) on an x86 btw.

Please CC responses, as I am not on the list.

Cheers,
Ben

__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Bug????
@ 2002-02-06  4:34 kabir.patel
  0 siblings, 0 replies; 19+ messages in thread
From: kabir.patel @ 2002-02-06  4:34 UTC (permalink / raw)
  To: me; +Cc: gcc-help





Remember the strange "opcode" error messages I was getting......



Well I didn't use "gas" in the end. I just (painfully) went through the code,
and removed lines at random, in the hope that the messages

would go away. Eventually they did. I had to remove a case statement.

I tried another piece of code and got the same error messages, so decided to
remove some of the case statements again. Again the

error messages disappeared. I did some testing and have now realised that when
more that 3 case statements are put into a switch expression

the "opcode" messages appear.

Is this a bug with the c compiler? Can any of you confirm my findings?

Thanks



*******************Internet Email Confidentiality Footer*******************


Privileged/Confidential Information may be contained in this message.  If you
are not the addressee indicated in this message (or responsible for delivery of
the message to such person), you may not copy or deliver this message to anyone.
In such case, you should destroy this message and kindly notify the sender by
reply email. Please advise immediately if you or your employer does not consent
to Internet email for messages of this kind.  Opinions, conclusions and other
information in this message that do not relate to the official business of my
firm shall be understood as neither given nor endorsed by it.


^ permalink raw reply	[flat|nested] 19+ messages in thread
* Bug?
@ 2003-09-20  7:45 Brian
  0 siblings, 0 replies; 19+ messages in thread
From: Brian @ 2003-09-20  7:45 UTC (permalink / raw)
  To: gcc-help

Whenever I try to insert a label before the 
"EPILOGUE_BEGIN" NOTE of a function that contains
a switch statement, I get an internal compiler error.

Again...It only happens when I process a function where
there is a SWITCH statement.

For now I can't allow any code with switch statements.
Ideas?  

Brian


^ permalink raw reply	[flat|nested] 19+ messages in thread
* bug?
@ 2005-08-25 23:33 Alexey Sokolov
  2005-08-26  1:06 ` bug? corey taylor
  2005-08-26 12:07 ` bug? Eljay Love-Jensen
  0 siblings, 2 replies; 19+ messages in thread
From: Alexey Sokolov @ 2005-08-25 23:33 UTC (permalink / raw)
  To: gcc-help

Hallo!
/**************************/
//example file "example.cpp"
//begin
#include <iostream.h>

main()
{
         char name[1]; //1 byte(!)
         name[0]='1';
         name[1]='2';
         name[2]='3';
         name[3]='4';
         name[4]='\0';
         cout << name << "\n";
}
//end
/**************************/

$g++ example.cpp
$./a.out
1234

1,2,3,4 and '\0' = 5 byte!
5 byte != 1 byte (char name[1];)!

But why? Forgive for English, I am simple Russian =)

--
#gcc --version
gcc (GCC) 3.4.2 [FreeBSD] 20040728

^ permalink raw reply	[flat|nested] 19+ messages in thread
* bug?
@ 2007-10-21 14:27 skaller
  2007-10-22 11:19 ` bug? John Love-Jensen
  0 siblings, 1 reply; 19+ messages in thread
From: skaller @ 2007-10-21 14:27 UTC (permalink / raw)
  To: gcc-help

This looks like a bug:

In file included from ./lpsrc/flx_pthread.pak:208,
                 from ./lpsrc/flx_pthread.pak:160,
                 from ./lpsrc/flx_pthread.pak:1507,
                 from ./lpsrc/flx_pthread.pak:1553:
/usr/include/c++/4.2/cstddef:55: error: ‘::ptrdiff_t’ has not been
declared

Can anyone see any way this could happen (C++ code,
using both <x.h> and <x> in various places).


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-10-22 16:42 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-15 15:57 bug? Ben Kohlen
2001-06-15 16:38 ` bug? David Berthelot
2001-06-15 18:59 ` bug? Alexandre Oliva
2001-06-17  2:55 ` bug? Ingo Krabbe
2001-06-18 10:06   ` bug? David Berthelot
2001-06-18 11:46     ` bug? Ingo Krabbe
2001-06-18 23:05       ` bug? Alexandre Oliva
2001-06-18 23:58         ` bug? Ingo Krabbe
2001-06-19  0:31           ` bug? Alexandre Oliva
2001-06-19  5:55             ` bug? Ingo Krabbe
2001-06-20  7:57               ` bug? Alexandre Oliva
2002-02-06  4:34 Bug???? kabir.patel
2003-09-20  7:45 Bug? Brian
2005-08-25 23:33 bug? Alexey Sokolov
2005-08-26  1:06 ` bug? corey taylor
2005-08-26 12:07 ` bug? Eljay Love-Jensen
2007-10-21 14:27 bug? skaller
2007-10-22 11:19 ` bug? John Love-Jensen
2007-10-23  8:04   ` bug? skaller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).