Categories
Development Linux Ubuntu

Bluetoot adapter configuration issue (ID 0a12:0001)

Bluetooth adapter does not work in Ubuntu. $ lsusb | grep tooth Bus 002 Device 003: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) $ hciconfig hci0: Type: Primary Bus: USB BD Address: 33:03:30:09:74:B4 ACL MTU: 360:4 SCO MTU: 0:0 DOWN RX bytes:1106 acl:0 sco:0 events:56 errors:0 TX bytes:736 acl:0 sco:0 commands:60 errors:0 […]

Categories
Development

Incorrect memory access: why is my kernel *not* crashing

I wanted to show to somebody an exemple of incorrect memory access (kernelspace trying to access userspace memory leading to a bug). Thus, I took an old tutorial as a POC, the important part is : static ssize_t dev_write(struct file *filep, const char *buffer, size_t len, loff_t *offset){ sprintf(message, “%s(%zu letters)”, buffer, len); // appending […]

Categories
Development

How to compile STUTTER lang on MacOSX 10.12

I am currently going over the super nice book “The Computational Beauty of Nature” by Gary W Flake, where he introduces the Stutter language. I am trying to install it on MacOSX 10.12.6 (Sierra). TL;DR: final solution is: edit stutter/Makefile and shell/Makefile and replace all instanced of -g root by -g wheel or -g sys […]

Categories
Development

Compiler warning from std::chrono but is not being used

NOTE: This bug only occurs after VS2019 has reconstructed a deleted .vs folder. To show this bug first create a new solution with a C++ console app. Then close the solution and delete the .vs folder. Re-open the solution and paste in the code below. Odd warnings involving std::chrono appear on this piece of code […]

Categories
Development

no matching operator delete found; memory will not be freed if initialization throws an exception

I have made a BaseObject class that overrides the new (and delete) operators, so I can log memory as it is created and destroyed during the lifecycle of my application, making it easy for me to spot any unreleased memory. However, I am getting the following errors when I compile (but it runs fine): resourcemanager.h(36): […]

Categories
Development Plugins

Build and compile gSOAP project with CMake (make) and GCC

I have a pretty basic question about CMake and I will appreciate any help. PROBLEM: When I try to compile gSOAP with pure GCC everything is fine, but when I use CMake to generate a Makefile and build it, I get a linkage error. Here is the working gcc command (But it’s not a good […]

Categories
Development

C – multiple warnings “pointer is missing a nullability type specifier” when compiling program, what do I do?

I recently started having problems with compiling C programs, getting 10, 20 or 100 warnings from the different C packages like stdio.h or stdlib.h. The warnings differ somewhat but usually say something like this: /usr/local/include/_stdio.h:93:16: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness] unsigned char *_base; My program still compiles […]

Categories
C++ Development

C++ variadic macro for pairs

I am aware of the MAP macro that can be used to apply a macro function to a variadic argument list. But how would you apply a macro function to pairs of variadic arguments? What I want to create is something like this: #define DECL_VAR(type,var)\ type _##var; #define DECL_GETSET(type,var)\ type get_##var() const {return _##var;}\ void […]