Errors compiling suggested sample code for cuDNN under Ubuntu

Nvidia’s cuDNN installation doc recommends testing successful
install by compiling the mnistCUDNN project from cudnn_samples_v7.
This generates a chain of errors, documented here:


https://devtalk.nvidia.com/default/topic/1044131/cudnn/cudann-mnistcudnn-make-fails-with-usr-local-cuda-include-cuda_runtime_api-h-2232-24-error-expected-lsquo-rsquo-before-lsquo-rsquo-token/

Suggested fix:

run sudo emacs /usr/local/cuda/include/cuda_runtime_api.h

Before this line:

typedef void (CUDART_CB *cudaStreamCallback_t)(cudaStream_t stream, cudaError_t status, void *userData);

add this code

#ifdef _WIN32
#define CUDART_CB __stdcall
#else
#define CUDART_CB
#endif


and here:

https://devtalk.nvidia.com/default/topic/1045857/tensorrt/onnx-tensorrt-build-failure/

and here:

https://devtalk.nvidia.com/default/topic/1025801/cudnn/cudnn-test-did-not-pass/

Suggested fix:

Open the file:
/usr/include/cudnn.h

And change the line:
#include “driver_types.h”

to:
#include <driver_types.h>


Judging from comments above, this seems to have persisted over a year or so.
Is there a reason why the errors are still present in the sample code?

Is there something inherently wrong about the system setup, or is the above an uncorrected error in the sample code?