A lot of warnings when compiling date library
The date library is very useful but you can see a lot of warnings after compiling a simple example that uses date library.
for example:
#include "date.h"
int main() {
using namespace date;
std::cout << weekday{July/4/2001} << 'n';
}
compiled with:
g++ -c -Waggregate-return main.cpp
warning: function call has aggregate value [-Waggregate-return]...
c++ date
|
show 2 more comments
The date library is very useful but you can see a lot of warnings after compiling a simple example that uses date library.
for example:
#include "date.h"
int main() {
using namespace date;
std::cout << weekday{July/4/2001} << 'n';
}
compiled with:
g++ -c -Waggregate-return main.cpp
warning: function call has aggregate value [-Waggregate-return]...
c++ date
1
Can you show us the warnings?
– mch
Nov 20 '18 at 9:00
What is your question?
– VTT
Nov 20 '18 at 9:00
yes, compile without errors but with a lot of warnings.
– sadig
Nov 20 '18 at 9:01
1
stackoverflow.com/questions/14016993/…
– The Unknown
Nov 20 '18 at 9:09
3
and what is the reason you compile with-Waggregate-return
? it is a pretty obscure (and useless) flag that triggers warnings for a valid C++ code.
– bolov
Nov 20 '18 at 10:10
|
show 2 more comments
The date library is very useful but you can see a lot of warnings after compiling a simple example that uses date library.
for example:
#include "date.h"
int main() {
using namespace date;
std::cout << weekday{July/4/2001} << 'n';
}
compiled with:
g++ -c -Waggregate-return main.cpp
warning: function call has aggregate value [-Waggregate-return]...
c++ date
The date library is very useful but you can see a lot of warnings after compiling a simple example that uses date library.
for example:
#include "date.h"
int main() {
using namespace date;
std::cout << weekday{July/4/2001} << 'n';
}
compiled with:
g++ -c -Waggregate-return main.cpp
warning: function call has aggregate value [-Waggregate-return]...
c++ date
c++ date
edited Nov 20 '18 at 10:56
M.K
359219
359219
asked Nov 20 '18 at 8:56
sadig
265
265
1
Can you show us the warnings?
– mch
Nov 20 '18 at 9:00
What is your question?
– VTT
Nov 20 '18 at 9:00
yes, compile without errors but with a lot of warnings.
– sadig
Nov 20 '18 at 9:01
1
stackoverflow.com/questions/14016993/…
– The Unknown
Nov 20 '18 at 9:09
3
and what is the reason you compile with-Waggregate-return
? it is a pretty obscure (and useless) flag that triggers warnings for a valid C++ code.
– bolov
Nov 20 '18 at 10:10
|
show 2 more comments
1
Can you show us the warnings?
– mch
Nov 20 '18 at 9:00
What is your question?
– VTT
Nov 20 '18 at 9:00
yes, compile without errors but with a lot of warnings.
– sadig
Nov 20 '18 at 9:01
1
stackoverflow.com/questions/14016993/…
– The Unknown
Nov 20 '18 at 9:09
3
and what is the reason you compile with-Waggregate-return
? it is a pretty obscure (and useless) flag that triggers warnings for a valid C++ code.
– bolov
Nov 20 '18 at 10:10
1
1
Can you show us the warnings?
– mch
Nov 20 '18 at 9:00
Can you show us the warnings?
– mch
Nov 20 '18 at 9:00
What is your question?
– VTT
Nov 20 '18 at 9:00
What is your question?
– VTT
Nov 20 '18 at 9:00
yes, compile without errors but with a lot of warnings.
– sadig
Nov 20 '18 at 9:01
yes, compile without errors but with a lot of warnings.
– sadig
Nov 20 '18 at 9:01
1
1
stackoverflow.com/questions/14016993/…
– The Unknown
Nov 20 '18 at 9:09
stackoverflow.com/questions/14016993/…
– The Unknown
Nov 20 '18 at 9:09
3
3
and what is the reason you compile with
-Waggregate-return
? it is a pretty obscure (and useless) flag that triggers warnings for a valid C++ code.– bolov
Nov 20 '18 at 10:10
and what is the reason you compile with
-Waggregate-return
? it is a pretty obscure (and useless) flag that triggers warnings for a valid C++ code.– bolov
Nov 20 '18 at 10:10
|
show 2 more comments
2 Answers
2
active
oldest
votes
Depending on the version of your compiler, C++11 (or later) mode might not be active, so try adding -std=gnu++0x
at least. Also you code needs #include <iostream>
added.
add a comment |
To fix these warnings you should remove the flag -Waggregate-return
from your compile string. This flag causes warnings for valid code.
Note that you also need #include <iostream>
, and for older versions of g++ , -std=c++14
or a similar flag.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389377%2fa-lot-of-warnings-when-compiling-date-library%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Depending on the version of your compiler, C++11 (or later) mode might not be active, so try adding -std=gnu++0x
at least. Also you code needs #include <iostream>
added.
add a comment |
Depending on the version of your compiler, C++11 (or later) mode might not be active, so try adding -std=gnu++0x
at least. Also you code needs #include <iostream>
added.
add a comment |
Depending on the version of your compiler, C++11 (or later) mode might not be active, so try adding -std=gnu++0x
at least. Also you code needs #include <iostream>
added.
Depending on the version of your compiler, C++11 (or later) mode might not be active, so try adding -std=gnu++0x
at least. Also you code needs #include <iostream>
added.
answered Nov 20 '18 at 10:04
Bo R
616110
616110
add a comment |
add a comment |
To fix these warnings you should remove the flag -Waggregate-return
from your compile string. This flag causes warnings for valid code.
Note that you also need #include <iostream>
, and for older versions of g++ , -std=c++14
or a similar flag.
add a comment |
To fix these warnings you should remove the flag -Waggregate-return
from your compile string. This flag causes warnings for valid code.
Note that you also need #include <iostream>
, and for older versions of g++ , -std=c++14
or a similar flag.
add a comment |
To fix these warnings you should remove the flag -Waggregate-return
from your compile string. This flag causes warnings for valid code.
Note that you also need #include <iostream>
, and for older versions of g++ , -std=c++14
or a similar flag.
To fix these warnings you should remove the flag -Waggregate-return
from your compile string. This flag causes warnings for valid code.
Note that you also need #include <iostream>
, and for older versions of g++ , -std=c++14
or a similar flag.
answered Nov 20 '18 at 10:19
M.M
104k11113234
104k11113234
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53389377%2fa-lot-of-warnings-when-compiling-date-library%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you show us the warnings?
– mch
Nov 20 '18 at 9:00
What is your question?
– VTT
Nov 20 '18 at 9:00
yes, compile without errors but with a lot of warnings.
– sadig
Nov 20 '18 at 9:01
1
stackoverflow.com/questions/14016993/…
– The Unknown
Nov 20 '18 at 9:09
3
and what is the reason you compile with
-Waggregate-return
? it is a pretty obscure (and useless) flag that triggers warnings for a valid C++ code.– bolov
Nov 20 '18 at 10:10