Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 6 years ago

Language

C++

Compiler

gcc HEAD 10.0.0 20190510 (experimental)

Options
Warnings
Optimization
Don't Use Boost
C++2a
no pedantic
Raw compiler options
-pedantic -pthread

Author

anonymous

about 6 years ago

$ g++ prog.cc -Wall -Wextra -O2 -march=native -std=c++2a -pedantic -pthread
prog.cc: In function 'void f(const char**)':
prog.cc:2:10: error: 'cout' is not a member of 'std'
    2 |     std::cout << (sizeof(strings)/8) << '\n'; // Output: 1
      |          ^~~~
prog.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
  +++ |+#include <iostream>
    1 | void f(const char* strings[]) {
prog.cc:2:33: warning: 'sizeof' on array function parameter 'strings' will return size of 'const char**' [-Wsizeof-array-argument]
    2 |     std::cout << (sizeof(strings)/8) << '\n'; // Output: 1
      |                                 ^
prog.cc:1:20: note: declared here
    1 | void f(const char* strings[]) {
      |        ~~~~~~~~~~~~^~~~~~~~~
prog.cc: In function 'int main()':
prog.cc:7:10: error: 'cout' is not a member of 'std'
    7 |     std::cout << (sizeof(strings)/8) << '\n'; // Output: 4
      |          ^~~~
prog.cc:7:10: note: 'std::cout' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
Exit Code:
1