Push to GitHub error: Couldn't find host github.com in the .netrc file; using defaults

I don't know, what is going on, I got no response from github. I tried a git push for the first time in a month or so and got this. Turned on export GIT_CURL_VERBOSE=1 and did a push and get...

#pragma pack effect

I was wondering if someone could explain to me what the #pragma pack preprocessor statement does, and more importantly, why one would want to use it. I checked out the MSDN page, which offered...

fastest c++ serialization?

I'm searching for a very fast binary serialization technique for c++. I only need to serialize data contained in objects (no pointers etc.). I'd like it to be as fast as possible. If it's specific...

Go to Definition Fails - Visual Studio 2008

I'm writing a C++ application in Visual Studio 2008. It has a lot of defined structures in several header files, such as: #pragma pack( push , 1 ) // align on a 1-byte...

Pushing to Git returning Error Code 403 fatal: HTTP request failed

I was able to clone a copy of this repo over HTTPS authenticated. I've made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7...

Are there performance issues when using pragma pack(1)?

Our headers use #pragma pack(1) around most of our structs (used for net and file I/O). I understand that it changes the alignment of structs from the default of 8 bytes, to an alignment of 1...

Why does padding have to be a power of two?

I am doing some sample programs to explore C and would like to know why structure padding can be done in power of two only. #include <stdio.h> #pragma pack(push, 3) union aaaa { struct bbb ...

Is it possible to find sizes of structures declared in a DLL?

We have the situation where we have a large number of inter-related DLLs that form our product. This is a very "old" product (as in it has been developed over 20 years) and has suffered in the...

C++ POD struct inheritance? Are there any guarantees about the memory layout of derived members

Let's say, I have a struct RGB and I want to create struct RGBA, which inherits RGB: struct RGB { unsigned char r; unsigned char g; unsigned char b; }; struct RGBA: RGB { unsigned char...

Compiler Warning when using Pointers to Packed Structure Members

Many C/C++ compilers (including gcc and clang) have a feature called packed structures. It comes in handy for a number of reasons, but it has to be used with caution. One potential pitfall is that...

Approach for automatic fields reordering in C-like structs

Is there a way to perform automatic fields reordering in C-like structs? I mean the using of the language features like( preprocessor for C and C++ and templates/type traits/etc for C++), which...

Struct w/ bit field: CPython and C padding differs

Consider the following program: #include <stddef.h> #include <stdio.h> typedef struct { unsigned bit:1; unsigned char str[8]; } test; #pragma pack(1) typedef struct { ...

Does packing a structure affect sub-structures?

We recently found some code submitted to our codebase, along the following lines: #pragma pack(push,1) struct xyzzy { BITMAPINFOHEADER header; char plugh; long twisty; } myVar; My...

Corrupted heap while display a BMP image on console

I have a exercise. It says, that the C program should be able to read the information of a bitmap file and after that it should display the picture on console. I have already written a code but...

gcc, enum is not packed as expected

The size of enum is not packed, why is that? typedef enum{ STATE_IDLE = 0, STATE_RUN, }State_t; #pragma pack(1) struct { char c; //1 State_t State; // should be 1 but is...

Ada Endianness Float/Integer

I'm a new developper in Ada so forgive me if I not clear enough. I am confronted with a problem and I do not know where from the fault can come. I explain first of all the context: I possess a...

How to use struct to read from file?

I need to simulate data stream(it can be reading from file) in the form of packages (struct in python is the proposed idea) which contain neccessary data about the package. Lets say the file is...

_mm256_load_ps cause segmentation fault with google/benchmark in debug mode

The following code can run in both release and debug mode. #include <immintrin.h> constexpr int n_batch = 10240; constexpr int n = n_batch * 8; #pragma pack(32) float a[n]; float b[n]; float...

wintun:ERROR_INVALID_PARAMETER on registering ring buffers

I am currently trying to get the wintun driver to work with my program for simple tunneling (see: https://www.wintun.net/ ). I successfully find and open the network device, but when it comes to...

How to create packed arrays of bit fields with SDCC?

I have a nested data structure containing arrays of bit fields which I need to compile with SDCC for the MCS-51 target. This is a simplified example: example.c struct data { unsigned char a :...

Why is #pragma considered a preprocessor directive?

I know it starts with #, and it follows the preprocessing directives format. But does the preprocessor really care about it? The #pragma pack, #pragma once, and all other directives I know, are...

Edge detection in 24-bit bmp using C

how are you? I have a question about an algorithm that I've been learning. It is the relatively simple algorithm, which helps to detect the edges of the image. In summary, the algorithm works like...

Building wheel for neural-renderer-pytorch (setup.py) ...installing multiperson and neural mesh renderer doesn't work for pytorch 1.6

I am trying to install a github repo named multiperson for PyTorch 1.6 and I get the following error. How can I make it work for PyTorch 1.6? (base) [email protected]:~/research$ cd phosa/ (base)...

Why can I not use my QML singleton module?

I have a simple test project at https://github.com/jh3010-qt-questions/font_test When I build it, I get the error: qrc:/main.qml:5 module "Fonts" is not installed My directory structure looks...

Eclipse EGit TFS Git Connection - Authentication not supported

Hi, We are facing this dreadful issue "authentication not supported" when using egit from eclipse. I have read many articles, questions but none of them seem to solve the issue at hand. We are...

TYPE_ALIGNMENT(LARGE_INTEGER) incorrect when building against Win10 SDK

I am running into issues with this assertion in the Win 10 SDK for Winnt.h, when upgrading from Win8.1 a C file which #includes winnt.h: C:\Program Files...

How to design structure elements in c language by offset

I would like to design c structure via padding by given offsets in less time and easy to modifications. Lets take an example, Assume my structure is the following: #pragma pack(push, 1) typedef...

Why is this UNION like a struct?

I came across some code (it's in a library from Microchip) which has a union. All was good, until I saw it assigned values to different members of the union right after each other. My immediate...

Pad a packed struct in C for 32-bit alignment

I have a struct defined that is used for messages sent across two different interfaces. One of them requires 32-bit alignment, but I need to minimize the space they take. Essentially I'm trying to...

What is the official Rust guidance for interoperability with C++, in particular passing and returning structs as arguments?

I'm trying to adapt some layers of existing C++ code to be used by Rust and apparently the way is through a C API. For example, one function might return a struct as an object #pragma...

Relevant tags