-
Notifications
You must be signed in to change notification settings - Fork 578
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
ml_utils.c: change use of c++11 posix standard function "gethostname"… #1810
Conversation
… to c99 standard "uname" Since cmake interprets this as a c file by name it only pulls in posix functions from the 98 standard. That meant that "gethostname" was an implicit declaration and that fails when running with warnings-as-errors.
@trilinos/ml |
I don't think these functions have anything to do with the C++11 and C99 standards at all? They are both in the |
Sure - this comes directly from the dashboard in the sierra replication builds. See https://testing.sandia.gov/cdash/viewBuildError.php?buildid=3143344 I did look into the unistd.h header and the notes from the gcc compiler team are what I was referencing as to the versions. I did confirm that the macros in units.h turn off declaration of gethostname when using -std=c99 which this does. I also tried to use -std=c++11 and the compiler said no as it's c code. We could work through and get it to use -std=c11 (we currently don't pass anything - not sure where c99 came from.) |
It looks like the compiler default will be c11 with gnu extensions. I think I will talk with Jim and Mike to see if all of Trilinos should be using that or the stricter c11. Sierra does not pass anything and so would get the gnu extensions. Thanks! |
Hmm you're right that its not being declared properly, I just confirmed while building Trilinos:
|
@jwillenbring - did this ever get discussed? |
@prwolfe Not that I recall, though I'm not @jwillenbring :-) . I would say, if it works, merge it. |
Pull request #1974 will take care of this until a full policy is established. |
Closed and moved to issue #1985 |
… to c99 standard "uname"
Since cmake interprets this as a c file by name it
only pulls in posix functions from the 98 standard.
That meant that "gethostname" was an implicit declaration
and that fails when running with warnings-as-errors.