zhangjl / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

Compiler errors and warnings when building 64-bit #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build the projects using the x64 architecture

What is the expected output? What do you see instead?
This generates an error in logging.cc line 1239 because the _asm keyword is
not supported in VS2005 under x64.
In addition there are >10 warnings about conversions from different int types.

What version of the product are you using? On what operating system?
glog-0.3.0, VS2005, Windows Vista 64-bit.

Please provide any additional information below.
The compiler error is not generated by VS2008, but the warnings are still
there.

Original issue reported on code.google.com by ragnar.c...@gmail.com on 2 Feb 2010 at 2:19

GoogleCodeExporter commented 9 years ago
Unfortunately, I don't have 64bit windows for now. Are there any suggestion how 
to 
fix _asm error? Just changing from

#if defined(_DEBUG) && defined(_MSC_VER)

to

#if defined(_DEBUG) && defined(_MSC_VER) && !defined(__x86_64__)

works as a quick solution?

Original comment by shinichi...@gmail.com on 18 Feb 2010 at 11:31

GoogleCodeExporter commented 9 years ago
Sorry, that does not do the trick.  The error changes to C4235: nonstandard 
extension 
used: '_asm' keyword not supported on this architecture

Original comment by robertsh...@gmail.com on 7 Apr 2010 at 2:05

GoogleCodeExporter commented 9 years ago
Thanks for your reply! I've just found this page: http://msdn.microsoft.com/en-
us/library/b0084kay(VS.80).aspx

It looks like

#if defined(_DEBUG) && defined(_MSC_VER) && !defined(_M_X64)

should work. Could you check if it works?

Thanks!

Original comment by shinichi...@gmail.com on 7 Apr 2010 at 2:26

GoogleCodeExporter commented 9 years ago
That did the trick.  Thanks for the quick turn-around.

Original comment by robertsh...@gmail.com on 7 Apr 2010 at 2:44

GoogleCodeExporter commented 9 years ago
Thanks for the report again! I'll commit this change later.

Original comment by shinichi...@gmail.com on 7 Apr 2010 at 2:48

GoogleCodeExporter commented 9 years ago
'_asm int 3' just triggers a breakpoint: better is to just do this with a call 
to 
DebugBreak(). No need to modify #if line at all.

(I had this line in my working copy so I could do a 64-bit Windows build 
myself. It 
looks like that's the only change besides to the VS projects.)

Original comment by eva...@gmail.com on 8 Apr 2010 at 5:19

GoogleCodeExporter commented 9 years ago
I have also test the __debugbreak(); and it works fine.

Original comment by pmou...@gmail.com on 7 Feb 2011 at 4:11

GoogleCodeExporter commented 9 years ago
Ping.

The various fixes mentioned here never seem to have actually made it into the 
repository.  As such there are still issues on 64-bit Windows due to _asm.

Is it possible to get logging.cc:1457 updated: _asm int 3 --> __debugbreak()

From this: http://msdn.microsoft.com/en-us/library/f408b4et.aspx it appears 
that it is the cleanest 32/64 agnostic way to invoke a breakpoint.

Thanks!

Original comment by alexs....@gmail.com on 17 Oct 2013 at 1:34