Introduce maybe_unused.
3 unresolved threads
3 unresolved threads
New section below the main
function to introduce the maybe_unused keyword.
Closes #137 (closed).
Merge request reports
Activity
added C++ label
- Resolved by GILLES Sebastien
- Resolved by GILLES Sebastien
- Resolved by GILLES Sebastien
Thanks for the corrections, good to merge!
Edited by DIAZ Jeromementioned in commit f2014dc5
1430 " return EXIT_SUCCESS;\n", 1431 "}" 1432 ] 1433 }, 1434 { 1435 "cell_type": "markdown", 1436 "metadata": {}, 1437 "source": [ 1438 "To counteract this you have three strategies:" 1439 ] 1440 }, 1441 { 1442 "cell_type": "markdown", 1443 "metadata": {}, 1444 "source": [ 1445 "### Not naming the parameters" 1454 "%%cppmagics --print_command clang\n", 1455 "\n", 1456 "#include <cstdlib>\n", 1457 "\n", 1458 "int main(int , char** )\n", 1459 "{\n", 1460 "\n", 1461 " return EXIT_SUCCESS;\n", 1462 "}" 1463 ] 1464 }, 1465 { 1466 "cell_type": "markdown", 1467 "metadata": {}, 1468 "source": [ 1469 "### Casting the parameters to void" 1480 "#include <cstdlib>\n", 1481 "\n", 1482 "int main(int argc, char** argv)\n", 1483 "{\n", 1484 " static_cast<void>(argc);\n", 1485 " static_cast<void>(argv);\n", 1486 "\n", 1487 " return EXIT_SUCCESS;\n", 1488 "}" 1489 ] 1490 }, 1491 { 1492 "cell_type": "markdown", 1493 "metadata": {}, 1494 "source": [ 1495 "### Using [[maybe_unused]] (since C++ 17)"
Please register or sign in to reply