Top "Compiler-bug" questions

For questions about (suspected) incorrect behavior of a compiler.

What is the behavior of printing NULL with printf's %s specifier?

Came across an interesting interview question: test 1: printf("test %s\n", NULL); printf("test %s\n", NULL); prints: test (null) …

c linux language-lawyer compiler-bug
'Delegate 'System.Action' does not take 0 arguments.' Is this a C# compiler bug (lambdas + two projects)?

Consider the code below. Looks like perfectly valid C# code right? //Project B using System; public delegate void ActionSurrogate(Action …

c# compiler-errors lambda compiler-bug
(this == null) in C#!

Due to a bug that was fixed in C# 4, the following program prints true. (Try it in LINQPad) void Main() { …

c# visual-studio-2010 compiler-bug
Error 83 error C2398: conversion from 'double' to 'float' requires a narrowing conversion

I have found many posts about this error but I could find how to overcome it. This is the code …

c++ c++11 casting floating-point compiler-bug
JDK 11.0.2 compilation fails with javac NPE on anonymous parameterized class type inference

Code (spring-web 5.1.2) public static void main(String[] args) { RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders(); headers.set(HttpHeaders.AUTHORIZATION, "…

java javac type-inference java-11 compiler-bug
In release mode, code behavior is not as expected

The following code generates different results under debug mode and release mode (using Visual Studio 2008): int _tmain(int argc, _TCHAR* …

c++ c optimization visual-studio-2008 compiler-bug