warning: format ‘%i’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat=]

I have created a vector (vectorR) of ints using shared memory in Linux, the code is as follows: int shmidR, tamR; tamR = fil*col2; int *vectorR[tamR]; // Creating the vector shmidR = shmget(IPC_PRIVATE, sizeof(int)*fil*col2, IPC_CREAT|0666); vectorR[tamR] = (int*) shmat(shmidR, NULL, 0); Then I operate on this vector and at the end i want to print… Read More warning: format ‘%i’ expects argument of type ‘int’, but argument 2 has type ‘int *’ [-Wformat=]

Possible null reference after null check

I have a problem resolving this CS8603 warning. Even though there is a null-check for resource variable, null reference is still possible. How come? Code: public string GetResource(string resourcePath) { var resource = Application.Current.Resources[resourcePath]; if (resource == null) { return $"{ResourceError} [{resourcePath}]"; } // ToDo: CS8603 return resource.ToString(); } >Solution : You did correctly check… Read More Possible null reference after null check

Supress UserWarning from torchmetrics

When I train a neural network using PyTorch, I get the following warning caused by the torchmetrics library: /Users/dev/miniconda/envs/pytorch/lib/python3.10/site-packages/torchmetrics/utilities/prints.py:36: UserWarning: Torchmetrics v0.9 introduced a new argument class property called full_state_update that has not been set for this class (SMAPE). The property determines if update by default needs access to the full metric state. If this… Read More Supress UserWarning from torchmetrics

Haskell warning

I have written the code (I’m new to haskell, very new) and cant solve the warning problem funk :: Num a => a -> a funk a = a + 10 main :: IO() main = print (funk 10 ) Warning: Warnings: 1 /home/anmnv/Desktop/qqq.hs: line 4, column 8: Warning: • Defaulting the following constraints to… Read More Haskell warning

Google Play Billing Library 5.0 deprecation warnings

Since I’ve upgraded the BillingClient to version 5.0.0: googleImplementation ‘com.android.billingclient:billing:5.0.0’ I get these unique deprecation warnings: warning: [deprecation] getSkus() in Purchase has been deprecated warning: [deprecation] getSkus() in PurchaseHistoryRecord has been deprecated warning: [deprecation] SkuType in BillingClient has been deprecated warning: [deprecation] SkuDetailsResponseListener in com.android.billingclient.api has been deprecated warning: [deprecation] SkuDetailsParams in com.android.billingclient.api has been… Read More Google Play Billing Library 5.0 deprecation warnings

Using isset on !$myvar['var']

I’m currently working through a large number of warnings I have logged after my server was updated to PHP 8. One particular point that has me scratching my head is the following code block if (!$option[‘type’] || $option[‘type’] == "select") { $output .= ‘<b>’.$option[‘title’].’:</b>’; } I know that I can use isset($option[‘type’]) like this isset($option[‘type’])… Read More Using isset on !$myvar['var']

C++ higher order functions: different results when declaring multiple functions

I was plying with higher order functions, and I started getting different results when I created two instances and assigning them to variables. I reduced the issue to the following example: #include <iostream> using ColorGetter = int(*)(void); auto paint(const ColorGetter &f) { return [&]() { return f(); }; } int colorA() { return 10; }… Read More C++ higher order functions: different results when declaring multiple functions