Re: VC6 to VC8 Conversion Compilation Errors



madhur.tiwari@xxxxxxxxx wrote:
I have gone thru two compilation errors that are posted at google
groups.

Environment: VS 2005 Beta2
language : VC8

 1. error C2059: syntax error : '__asm'
http://groups.google.com/group/microsoft.public.vc.language/browse_frm/thread/648e13a9bb35246a/e1b8387f668263a9?tvc=1&q=illegal+declaration+of+anonymous+%27struct%27&hl=en#e1b8387f668263a9

Solution:  disable C++ Language extensions : Yes(/Za)

&
2. error C2467: illegal declaration of anonymous 'struct'
http://groups.google.com/group/microsoft.public.dotnet.languages.vc/browse_frm/thread/4a5ec7266d7e82d9/055991222dc0877f?lnk=st&q=error+C2059:+syntax+error+:+%27__asm%27&rnum=3&hl=en#055991222dc0877f

Solution: disable C++ Language extensions : No

I'm facing both problem so how can I getover these both problems?

Solve one of them at a time with or without disabling language extensions.

Do you really need the assembly code in your C++?  Can you not achieve the
same functionality without it?  Can you extract it into a separate module?

If your declaration of an anonymous struct is illegal, wouldn't it be
generally better to get rid of it or make it legal?

All in all, if both errors occur in the same file, you can split the file
and compile one of the resulting units with /Za and the other without it.
If they are already in two different files, what's stopping you from
simply applying /Za to only one of them?

V
.



Relevant Pages

  • Re: [ANNOUNCE] System Inactivity Monitor v1.0
    ... I do not think your kernel code is mergeable. ... similar functionality in userspace probably would be mergeable. ... struct input_handle *handle; ...
    (Linux-Kernel)
  • [patch 1/2] hrtimer
    ... The removal of the data field in the hrtimer structure enforces the embedding ... implementation of the most common used timer callback function. ... In order to avoid the reimplentation of such functionality all over the place ... struct hrtimer_base - the timer base for a specific clock ...
    (Linux-Kernel)
  • Re: illegal declaration of anonymous struct
    ... > While compiling some sources using VC6, ... > illegal declaration of anonymous 'struct' ...
    (microsoft.public.vc.language)
  • [PATCH 02/14] page-replace-try_pageout.patch
    ... Move the functionality of the shrink_listloop into its own function. ... struct scan_control { ... #ifdef CONFIG_SWAP ...
    (Linux-Kernel)
  • TimeSpan Convenience
    ... What is best-practise to achieve functionality similar to .Net's System.TimeSpan struct in Java? ... I've created my own TimeSpan class but I wonder what Java-pro's use everyday? ...
    (comp.lang.java.programmer)