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

Backport [C++] Allow compiling front-end with strict warnings #8909

Merged
merged 1 commit into from
Nov 4, 2018

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Nov 4, 2018

Based on #8807.

@ibuclaw ibuclaw added GDC Gnu D Compiler Trivial typos, formatting, comments C++ Port labels Nov 4, 2018
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "dmd-cxx + dmd#8909"

@thewilsonator thewilsonator merged commit f0a235c into dlang:dmd-cxx Nov 4, 2018
@ibuclaw ibuclaw deleted the dmd-cxx-pedantic branch November 4, 2018 01:38
@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 4, 2018

I didn't check the build, but it seems like you didn't either. ;-)

@thewilsonator
Copy link
Contributor

I waited till semaphore passed.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 4, 2018

I don't think it should have passed... :-o

@thewilsonator
Copy link
Contributor

Oh, silly question: why?

@thewilsonator
Copy link
Contributor

I was expecting the autotester, Travis and build kite to fail, which they did. I took semaphore passing as a sign that is was working.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 4, 2018

declaration.c:90:13: error: no declaration matches ‘const char* Declaration::kind()’
90 | const char *Declaration::kind()
   |             ^~~~~~~~~~~
In file included from declaration.c:18:
declaration.h:130:17: note: candidate is: ‘virtual const char* Declaration::kind() const’
130 |     const char *kind() const;
    |                 ^~~~
declaration.h:117:7: note: ‘class Declaration’ defined here
117 | class Declaration : public Dsymbol
    |       ^~~~~~~~~~~
declaration.c:191:13: error: no declaration matches ‘const char* TupleDeclaration::kind()’
191 | const char *TupleDeclaration::kind()
    |             ^~~~~~~~~~~~~~~~
In file included from declaration.c:18:
declaration.h:180:17: note: candidate is: ‘virtual const char* TupleDeclaration::kind() const’
180 |     const char *kind() const;
    |                 ^~~~
declaration.h:170:7: note: ‘class TupleDeclaration’ defined here
170 | class TupleDeclaration : public Declaration
    |       ^~~~~~~~~~~~~~~~
declaration.c:578:13: error: no declaration matches ‘const char* AliasDeclaration::kind()’
578 | const char *AliasDeclaration::kind()
    |             ^~~~~~~~~~~~~~~~
In file included from declaration.c:18:
declaration.h:205:17: note: candidate is: ‘virtual const char* AliasDeclaration::kind() const’
205 |     const char *kind() const;
    |                 ^~~~
declaration.h:191:7: note: ‘class AliasDeclaration’ defined here
191 | class AliasDeclaration : public Declaration
    |       ^~~~~~~~~~~~~~~~
declaration.c:708:13: error: no declaration matches ‘const char* OverDeclaration::kind()’
708 | const char *OverDeclaration::kind()
    |             ^~~~~~~~~~~~~~~
In file included from declaration.c:18:
declaration.h:225:17: note: candidate is: ‘virtual const char* OverDeclaration::kind() const’
225 |     const char *kind() const;
    |                 ^~~~
declaration.h:217:7: note: ‘class OverDeclaration’ defined here
217 | class OverDeclaration : public Declaration
    |       ^~~~~~~~~~~~~~~
dclass.c:1392:13: error: no declaration matches ‘const char* ClassDeclaration::kind()’
1392 | const char *ClassDeclaration::kind()
     |             ^~~~~~~~~~~~~~~~
In file included from dclass.c:24:
aggregate.h:309:17: note: candidate is: ‘virtual const char* ClassDeclaration::kind() const’
309 |     const char *kind() const;
    |                 ^~~~
aggregate.h:251:7: note: ‘class ClassDeclaration’ defined here
251 | class ClassDeclaration : public AggregateDeclaration
    |       ^~~~~~~~~~~~~~~~
declaration.c:1773:13: error: no declaration matches ‘const char* VarDeclaration::kind()’
1773 | const char *VarDeclaration::kind()
     |             ^~~~~~~~~~~~~~
In file included from declaration.c:18:
declaration.h:272:17: note: candidate is: ‘virtual const char* VarDeclaration::kind() const’
272 |     const char *kind() const;
    |                 ^~~~
declaration.h:240:7: note: ‘class VarDeclaration’ defined here
240 | class VarDeclaration : public Declaration
    |       ^~~~~~~~~~~~~~
dsymbol.c:296:13: error: no declaration matches ‘const char* Dsymbol::kind()’
296 | const char *Dsymbol::kind()
    |             ^~~~~~~
In file included from dsymbol.c:21:
dsymbol.h:196:25: note: candidate is: ‘virtual const char* Dsymbol::kind() const’
196 |     virtual const char *kind() const;
    |                         ^~~~
In file included from dsymbol.c:21:
dsymbol.h:149:7: note: ‘class Dsymbol’ defined here
149 | class Dsymbol : public RootObject
    |       ^~~~~~~
dclass.c:1830:13: error: no declaration matches ‘const char* InterfaceDeclaration::kind()’
1830 | const char *InterfaceDeclaration::kind()
     |             ^~~~~~~~~~~~~~~~~~~~
In file included from dclass.c:24:
aggregate.h:329:17: note: candidate is: ‘virtual const char* InterfaceDeclaration::kind() const’
329 |     const char *kind() const;
    |                 ^~~~
aggregate.h:320:7: note: ‘class InterfaceDeclaration’ defined here
320 | class InterfaceDeclaration : public ClassDeclaration
    |       ^~~~~~~~~~~~~~~~~~~~
dsymbol.c:924:13: error: no declaration matches ‘const char* OverloadSet::kind()’
924 | const char *OverloadSet::kind()
    |             ^~~~~~~~~~~
In file included from dsymbol.c:21:
dsymbol.h:369:17: note: candidate is: ‘virtual const char* OverloadSet::kind() const’
369 |     const char *kind() const;
    |                 ^~~~
dsymbol.h:361:7: note: ‘class OverloadSet’ defined here
361 | class OverloadSet : public Dsymbol
    |       ^~~~~~~~~~~
dsymbol.c:1276:13: error: no declaration matches ‘const char* ScopeDsymbol::kind()’
1276 | const char *ScopeDsymbol::kind()
     |             ^~~~~~~~~~~~
In file included from dsymbol.c:21:
dsymbol.h:312:17: note: candidate is: ‘virtual const char* ScopeDsymbol::kind() const’
312 |     const char *kind() const;
    |                 ^~~~
dsymbol.h:288:7: note: ‘class ScopeDsymbol’ defined here
288 | class ScopeDsymbol : public Dsymbol
    |       ^~~~~~~~~~~~

And a few more related errors in other files that were touched here. :-)

@thewilsonator
Copy link
Contributor

Note to self, be less trigger happy and don't trust semaphore.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 4, 2018

I was expecting the autotester, Travis and build kite to fail, which they did. I took semaphore passing as a sign that is was working.

SemaphoreCI is a no-op for this branch. Travis is the only one to trust here.

@ibuclaw
Copy link
Member Author

ibuclaw commented Nov 4, 2018

I'll rolling up the fix into the next PR...

@thewilsonator
Copy link
Contributor

Duly noted. Thanks!

kraj pushed a commit to kraj/gcc that referenced this pull request Nov 5, 2018
This introduces a new header that pulls in system includes for use only
in the DMD front-end part of the compiler, fixing up uses of problematic
functions that are prevalent throughout the code.

Commits merged from dmd.

    Fix build of the D frontend on the Hurd and KFreeBSD.
    Initial patch from Matthias Klose.
    dlang/dmd#8893

    Don't care about D/C++ compatibility in C++ port.
    Fixes build error in https://gcc.gnu.org/PR87788
    dlang/dmd#8895

    Allow compiling front-end headers with strict warnings.
    dlang/dmd#8909

    Add root/system.h header for wrapping system includes.
    Fixes https://gcc.gnu.org/PR87865
    dlang/dmd#8910

    Move checkedint to dmd/root.
    dlang/dmd#8912

    Use rmem instead of libc for malloc() and strdup().
    dlang/dmd#8913

    Use align(8) for alignment of UnionExp, fixing several BUS errors
    due to alignment issues on SPARC.
    dlang/dmd#8914

    Don't pass NULL pointer as format parameter to errorSupplemental.
    dlang/dmd#8916

gcc/d/ChangeLog:

2018-11-05  Iain Buclaw  <ibuclaw@gdcproject.org>

	PR d/87865
	* d-system.h: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@265780 138bc75d-0d04-0410-961f-82ee72b054a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ Port GDC Gnu D Compiler Trivial typos, formatting, comments
Projects
None yet
3 participants