# Warning: null passed to a callee that requires a non-null argument \[-Wnonnull\]

**URL:** <https://root-forum.cern.ch/t/warning-null-passed-to-a-callee-that-requires-a-non-null-argument-wnonnull/30106>\
**Category:** TMVA\
**Created:** [August 3, 2018, 8:29am UTC](https://root-forum.cern.ch/t/warning-null-passed-to-a-callee-that-requires-a-non-null-argument-wnonnull/30106 "2018-08-03T08:29:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KarenDmn](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@KarenDmn](https://root-forum.cern.ch/u/KarenDmn)\
**Post date:** [August 3, 2018, 8:29am UTC](https://root-forum.cern.ch/t/warning-null-passed-to-a-callee-that-requires-a-non-null-argument-wnonnull/30106/1 "2018-08-03T08:29:31Z")

</div>

Hello dear ROOTForum

I am modifying theTMVAClassificationApplication.C with my own root file, and I get this:

```auto
warning: null passed to a callee that requires a non-null argument [-Wnonnull]
   std::cout << "--- TMVAClassificationApp : Using input file: " << input->GetName() << std::endl;

```

I followed as accurate as possible the tutorial macro but I don’t see the error. Could you please give me a hand?

I attach the root file and the modified macros of classification and application [TMVAClassification\_socialfinal.C](https://root-forum.cern.ch/uploads/default/original/3X/b/8/b862be19ec2ff9345996766d0b3df145f12c8c4f.C) (17.5 KB)  
[TMVAClassificationApplication\_socialfinal.C](https://root-forum.cern.ch/uploads/default/original/3X/e/5/e57675b01f301c785aa1c35024f6dc57d6839d38.C) (22.1 KB)  
[Data\_social\_training.root](https://root-forum.cern.ch/uploads/default/original/3X/a/2/a2d284e9b62a9e40aa05ce905dc823f956ae37af.root) (130.3 KB)

Thanks for your attention and have a nice day 🙂

Cheers,  
Karen

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [August 3, 2018, 10:49am UTC](https://root-forum.cern.ch/t/warning-null-passed-to-a-callee-that-requires-a-non-null-argument-wnonnull/30106/2 "2018-08-03T10:49:19Z")

</div>

Hi Karen,

You don’t open your input file. (All the logic for that is commented out. Check lines 232 through 248.)

In general, warnings and errors usually indicate the position in the file were the warning/error occurs which can help debugging immensly!

Cheers,  
Kim

---

<div class="post-metadata">

**Author:** ![KarenDmn](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/a9a28c/32.png) [@KarenDmn](https://root-forum.cern.ch/u/KarenDmn)\
**Post date:** [August 4, 2018, 9:45pm UTC](https://root-forum.cern.ch/t/warning-null-passed-to-a-callee-that-requires-a-non-null-argument-wnonnull/30106/3 "2018-08-04T21:45:58Z")

</div>

Hello kialbert,

You were right, I only had to open my input file. I used

```auto
TFile* file = TFile::Open("xfile.root");
...
file->GetName()

```

and it works, thanks a lot.

Cheers,  
Karen

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [August 7, 2018, 1:41pm UTC](https://root-forum.cern.ch/t/warning-null-passed-to-a-callee-that-requires-a-non-null-argument-wnonnull/30106/4 "2018-08-07T13:41:40Z")

</div>

Glad to be of help Karen!

If you found a solution to your problem please mark the post that provided the it as such 🙂

Cheers,  
Kim
