Skip to content

Comments

add warning#2

Merged
yaito3014 merged 25 commits intomainfrom
add-warning
Apr 25, 2025
Merged

add warning#2
yaito3014 merged 25 commits intomainfrom
add-warning

Conversation

@yaito3014
Copy link
Member

No description provided.

@github-actions
Copy link

compilation output is:

[object Object],[object Object],[object Object]

@github-actions
Copy link

compilation output is:

[{"filename":"source.cpp","line":3,"column":2,"type":"warning","text":"#warning \"WARNNING: This is a warning message\" [-Wcpp]","codeWhitespace":"    ","code":"#warning \"WARNNING: This is a warning message\"","adjustedColumn":-2,"startIndex":0,"endIndex":145},{"filename":"source.cpp","line":5,"column":19,"type":"note","text":"declared here","codeWhitespace":"    ","code":"[[nodiscard]] int func() { return 42; }","adjustedColumn":15,"startIndex":343,"endIndex":455},{"filename":"source.cpp","line":8,"column":7,"type":"warning","text":"unused variable ‘unused_variable’ [-Wunused-variable]","codeWhitespace":"    ","code":"int unused_variable = 42;","adjustedColumn":3,"startIndex":459,"endIndex":589}]

@github-actions
Copy link

compilation output is:

	

@github-actions
Copy link

compilation output is:

[
	{
		"error_or_warning": {
			"filename": "source.cpp",
			"line": 3,
			"column": 2,
			"type": "warning",
			"text": "#warning \"WARNNING: This is a warning message\" [-Wcpp]",
			"codeWhitespace": "    ",
			"code": "#warning \"WARNNING: This is a warning message\"",
			"adjustedColumn": -2,
			"startIndex": 0,
			"endIndex": 145
		},
		"notes": [
			{
				"filename": "source.cpp",
				"line": 3,
				"column": 2,
				"type": "warning",
				"text": "#warning \"WARNNING: This is a warning message\" [-Wcpp]",
				"codeWhitespace": "    ",
				"code": "#warning \"WARNNING: This is a warning message\"",
				"adjustedColumn": -2,
				"startIndex": 0,
				"endIndex": 145
			},
			{
				"filename": "source.cpp",
				"line": 5,
				"column": 19,
				"type": "note",
				"text": "declared here",
				"codeWhitespace": "    ",
				"code": "[[nodiscard]] int func() { return 42; }",
				"adjustedColumn": 15,
				"startIndex": 343,
				"endIndex": 455
			}
		]
	},
	{
		"error_or_warning": {
			"filename": "source.cpp",
			"line": 8,
			"column": 7,
			"type": "warning",
			"text": "unused variable ‘unused_variable’ [-Wunused-variable]",
			"codeWhitespace": "    ",
			"code": "int unused_variable = 42;",
			"adjustedColumn": 3,
			"startIndex": 459,
			"endIndex": 589
		},
		"notes": [
			{
				"filename": "source.cpp",
				"line": 8,
				"column": 7,
				"type": "warning",
				"text": "unused variable ‘unused_variable’ [-Wunused-variable]",
				"codeWhitespace": "    ",
				"code": "int unused_variable = 42;",
				"adjustedColumn": 3,
				"startIndex": 459,
				"endIndex": 589
			}
		]
	}
]

@github-actions
Copy link

compilation output is:

[
  {
    "error_or_warning": {
      "filename": "source.cpp",
      "line": 3,
      "column": 2,
      "type": "warning",
      "text": "#warning \"WARNNING: This is a warning message\" [-Wcpp]",
      "codeWhitespace": "    ",
      "code": "#warning \"WARNNING: This is a warning message\"",
      "adjustedColumn": -2,
      "startIndex": 0,
      "endIndex": 145
    },
    "notes": [
      {
        "filename": "source.cpp",
        "line": 5,
        "column": 19,
        "type": "note",
        "text": "declared here",
        "codeWhitespace": "    ",
        "code": "[[nodiscard]] int func() { return 42; }",
        "adjustedColumn": 15,
        "startIndex": 343,
        "endIndex": 455
      }
    ]
  },
  {
    "error_or_warning": {
      "filename": "source.cpp",
      "line": 8,
      "column": 7,
      "type": "warning",
      "text": "unused variable ‘unused_variable’ [-Wunused-variable]",
      "codeWhitespace": "    ",
      "code": "int unused_variable = 42;",
      "adjustedColumn": 3,
      "startIndex": 459,
      "endIndex": 589
    },
    "notes": []
  }
]

@github-actions
Copy link

compilation output is:

function toString(encoding, start, end) {
  if (arguments.length === 0) {
    return this.utf8Slice(0, this.length);
  }

  const len = this.length;

  if (start <= 0)
    start = 0;
  else if (start >= len)
    return '';
  else
    start = MathTrunc(start) || 0;

  if (end === undefined || end > len)
    end = len;
  else
    end = MathTrunc(end) || 0;

  if (end <= start)
    return '';

  if (encoding === undefined)
    return this.utf8Slice(start, end);

  const ops = getEncodingOps(encoding);
  if (ops === undefined)
    throw new ERR_UNKNOWN_ENCODING(encoding);

  return ops.slice(this, start, end);
}

@github-actions
Copy link

compilation output is:

source.cpp:3:2: warning: #warning "WARNNING: This is a warning message" [-Wcpp]
    3 | #warning "WARNNING: This is a warning message"
      |  ^~~~~~~
source.cpp: In function ‘int main()’:
source.cpp:9:7: warning: ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    9 |   func();
      |   ~~~~^~
source.cpp:5:19: note: declared here
    5 | [[nodiscard]] int func() { return 42; }
      |                   ^~~~
source.cpp:8:7: warning: unused variable ‘unused_variable’ [-Wunused-variable]
    8 |   int unused_variable = 42;
      |       ^~~~~~~~~~~~~~~

@github-actions
Copy link

detected warnings in the compilation output:

compilation output

source.cpp:3:2: warning: #warning "WARNNING: This is a warning message" [-Wcpp]
    3 | #warning "WARNNING: This is a warning message"
      |  ^~~~~~~
source.cpp: In function ‘int main()’:
source.cpp:9:7: warning: ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    9 |   func();
      |   ~~~~^~
source.cpp:5:19: note: declared here
    5 | [[nodiscard]] int func() { return 42; }
      |                   ^~~~
source.cpp:8:7: warning: unused variable ‘unused_variable’ [-Wunused-variable]
    8 |   int unused_variable = 42;
      |       ^~~~~~~~~~~~~~~

@github-actions
Copy link

detected warnings in the compilation output:

compilation output

[ 50%] Building CXX object CMakeFiles/hello_world.dir/source.cpp.o
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning before C++23 is a GCC extension
    3 | #warning "WARNNING: This is a warning message"
      |  ^~~~~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning "WARNNING: This is a warning message" [-Wcpp]
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp: In function ‘int main()’:
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:9:7: warning: ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    9 |   func();
      |   ~~~~^~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:5:19: note: declared here
    5 | [[nodiscard]] int func() { return 42; }
      |                   ^~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:8:7: warning: unused variable ‘unused_variable’ [-Wunused-variable]
    8 |   int unused_variable = 42;
      |       ^~~~~~~~~~~~~~~
[100%] Linking CXX executable hello_world
[100%] Built target hello_world

@github-actions
Copy link

detected warnings in the compilation output:

compilation output

#cppwarningnotifier commit=f049d4de48369c99ea22362316f55f4dcd7d986f\n
[ 50%] Building CXX object CMakeFiles/hello_world.dir/source.cpp.o
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning before C++23 is a GCC extension
    3 | #warning "WARNNING: This is a warning message"
      |  ^~~~~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning "WARNNING: This is a warning message" [-Wcpp]
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp: In function ‘int main()’:
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:9:7: warning: ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    9 |   func();
      |   ~~~~^~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:5:19: note: declared here
    5 | [[nodiscard]] int func() { return 42; }
      |                   ^~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:8:7: warning: unused variable ‘unused_variable’ [-Wunused-variable]
    8 |   int unused_variable = 42;
      |       ^~~~~~~~~~~~~~~
[100%] Linking CXX executable hello_world
[100%] Built target hello_world

@github-actions
Copy link

detected warnings in the compilation output:

compilation output

#cppwarningnotifier commit=9aac14fce8e96a88b633116c2a93f54d7ee69c28

[ 50%] Building CXX object CMakeFiles/hello_world.dir/source.cpp.o
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning before C++23 is a GCC extension
    3 | #warning "WARNNING: This is a warning message"
      |  ^~~~~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning "WARNNING: This is a warning message" [-Wcpp]
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp: In function ‘int main()’:
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:9:7: warning: ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    9 |   func();
      |   ~~~~^~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:5:19: note: declared here
    5 | [[nodiscard]] int func() { return 42; }
      |                   ^~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:8:7: warning: unused variable ‘unused_variable’ [-Wunused-variable]
    8 |   int unused_variable = 42;
      |       ^~~~~~~~~~~~~~~
[100%] Linking CXX executable hello_world
[100%] Built target hello_world

@github-actions
Copy link

detected warnings in the compilation output:

compilation output

#cppwarningnotifier commit=5c34e0d1ad2883a717bb95d0b154fca5ac1a48d9
[ 50%] Building CXX object CMakeFiles/hello_world.dir/source.cpp.o
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning before C++23 is a GCC extension
    3 | #warning "WARNNING: This is a warning message"
      |  ^~~~~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning "WARNNING: This is a warning message" [-Wcpp]
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp: In function ‘int main()’:
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:9:7: warning: ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    9 |   func();
      |   ~~~~^~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:5:19: note: declared here
    5 | [[nodiscard]] int func() { return 42; }
      |                   ^~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:8:7: warning: unused variable ‘unused_variable’ [-Wunused-variable]
    8 |   int unused_variable = 42;
      |       ^~~~~~~~~~~~~~~
[100%] Linking CXX executable hello_world
[100%] Built target hello_world

@cppwarningnotifier
Copy link

detected warnings in the compilation output:

compilation output

#cppwarningnotifier commit=82bc93ca14b3747075d9002988209acc6b1a5fb1
[ 50%] Building CXX object CMakeFiles/hello_world.dir/source.cpp.o
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning before C++23 is a GCC extension
    3 | #warning "WARNNING: This is a warning message"
      |  ^~~~~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:3:2: warning: #warning "WARNNING: This is a warning message" [-Wcpp]
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp: In function ‘int main()’:
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:9:7: warning: ignoring return value of ‘int func()’, declared with attribute ‘nodiscard’ [-Wunused-result]
    9 |   func();
      |   ~~~~^~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:5:19: note: declared here
    5 | [[nodiscard]] int func() { return 42; }
      |                   ^~~~
/home/runner/work/cpp-warning-notifier/cpp-warning-notifier/source.cpp:8:7: warning: unused variable ‘unused_variable’ [-Wunused-variable]
    8 |   int unused_variable = 42;
      |       ^~~~~~~~~~~~~~~
[100%] Linking CXX executable hello_world
[100%] Built target hello_world

@yaito3014 yaito3014 merged commit 3497fc6 into main Apr 25, 2025
2 checks passed
@yaito3014 yaito3014 deleted the add-warning branch April 25, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant