Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint checker, munmap friendly for mingw? #1

Closed
ghost opened this issue Feb 18, 2015 · 5 comments
Closed

Lint checker, munmap friendly for mingw? #1

ghost opened this issue Feb 18, 2015 · 5 comments

Comments

@ghost
Copy link

ghost commented Feb 18, 2015

Adding -D_MSC_VER also not working and I got a lot of errors
gcc4.9

In file included from D:/mingw32/i686-w64-mingw32/include/combaseapi.h:154:0,
                 from D:/mingw32/i686-w64-mingw32/include/objbase.h:14,
                 from D:/mingw32/i686-w64-mingw32/include/ole2.h:17,
                 from D:/mingw32/i686-w64-mingw32/include/wtypes.h:12,
                 from D:/mingw32/i686-w64-mingw32/include/winscard.h:10,
                 from D:/mingw32/i686-w64-mingw32/include/windows.h:97,
                 from mmap.h:6,
                 from peglint.cc:11:
D:/mingw32/i686-w64-mingw32/include/unknwnbase.h: In member function 'HRESULT IUnknown::QueryInterface(Q**)':
D:/mingw32/i686-w64-mingw32/include/unknwnbase.h:74:39: error: expected primary-expression before ')' token
       return QueryInterface(__uuidof(Q), (void **)pp);
                                       ^
D:/mingw32/i686-w64-mingw32/include/unknwnbase.h:74:39: error: there are no arguments to '__uuidof' that depend on a template parameter, so a declaration of '__uuidof' must be available [-fpermissive]
D:/mingw32/i686-w64-mingw32/include/unknwnbase.h:74:39: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from D:/mingw32/i686-w64-mingw32/include/urlmon.h:289:0,
                 from D:/mingw32/i686-w64-mingw32/include/objbase.h:163,
                 from D:/mingw32/i686-w64-mingw32/include/ole2.h:17,
                 from D:/mingw32/i686-w64-mingw32/include/wtypes.h:12,
                 from D:/mingw32/i686-w64-mingw32/include/winscard.h:10,
                 from D:/mingw32/i686-w64-mingw32/include/windows.h:97,
                 from mmap.h:6,
                 from peglint.cc:11:
D:/mingw32/i686-w64-mingw32/include/servprov.h: In member function 'HRESULT IServiceProvider::QueryService(const GUID&, Q**)':
D:/mingw32/i686-w64-mingw32/include/servprov.h:66:46: error: expected primary-expression before ')' token
   return QueryService(guidService, __uuidof(Q), (void **)pp);
                                              ^
D:/mingw32/i686-w64-mingw32/include/servprov.h:66:46: error: there are no arguments to '__uuidof' that depend on a template parameter, so a declaration of '__uuidof' must be available [-fpermissive]
@yhirose
Copy link
Owner

yhirose commented Feb 18, 2015

@kangjoni76 Thanks for the report. According to the log, the line #6 causes the problem. But, it just includes #include <windows.h>.

Can you please check if you could compile the following code on your environment?

#include <iostream>
#include <windows.h>
int main(int argc, char *argv[]) {
    std::cout << "hello world\n";
}

Thanks!!

@ghost
Copy link
Author

ghost commented Feb 18, 2015

compiled fine above code, Hi I just realized that this would be nice to add overload mutable lambdas actions. Since we cannot modify outer var to push into vector ?

@yhirose
Copy link
Owner

yhirose commented Feb 18, 2015

Thanks for the feedback.

compiled fine above code,

I'll try to setup the same environment that you are working on to reproduce the problem.
Did you install MinGW or Mingw-w64? (I am not familiar to MinGW...)

Hi I just realized that this would be nice to add overload mutable lambdas actions. Since we cannot modify outer var to push into vector ?

It would be better to separate the topic from this issue. Can you please make another issue for it and show some code examples to describe what you would like to do?

Thank you.

@ghost
Copy link
Author

ghost commented Feb 18, 2015

I'll try to setup the same environment that you are working on to reproduce the problem.
Did you install MinGW or Mingw-w64? (I am not familiar to MinGW...)
Yes I used that.
It would be better to separate the topic from this issue. Can you please make another issue for it and show some code examples to describe what you >would like to do?
yes created issue here #2

@yhirose
Copy link
Owner

yhirose commented Feb 19, 2015

I have installed Mingw-w64 and looked into the problem. Actually, g++ cannot compile the following code as a.cc (c++ source file), but can compile it as a.c (c source file). It's definitely a bug of g++ in Mingw-w64.

#include <iostream>
#include <windows.h>
int main(int argc, char *argv[]) {
    std::cout << "hello world\n";
}

But, I'll going to make a change not to use mmap.h, so that g++ in Mingw-w64 could comile the peglint.cc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant